-
Notifications
You must be signed in to change notification settings - Fork 0
Invoker base #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invoker base #5
Conversation
| func (r *ResponseFiles) Get(fileName string) (string, bool) { | ||
| for _, f := range r.fileNames { | ||
| if fileName == f { | ||
| return filepath.Join(r.R.BaseFolder, r.fileNames[0]), true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут точно fileNames[0]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Справедливо
|
|
||
| func fillInInvokerConfig(config *InvokerConfig) { | ||
| if config.QueueSize == nil { | ||
| config.QueueSize = pointer.Int(10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
в константу бы
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
хз на самом деле, тут по сути все эти fillIN это одна большая константная функция, там тогда константы на каждое поле надо делать и читать это будет невозможно. Тут как раз удобно что ты быстренько на код посмотрел и понял какие дефолт значения
|
|
||
| func RespOK(c *gin.Context, data gin.H) { | ||
| c.JSON(http.StatusOK, gin.H{ | ||
| "ok": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а зачем передавать этот ок, если есть статус код?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А это вообще я потом поменяю на другую схему, через несколько дней напишу свое видиние нашей отказоучтойчивости и будем это обсуждать
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ну и там вообще все полностью поменяется потом в этом респонзе
| // For uploads, FilePath or FilePaths should be specified (depending on whether the resource is single-file or not). | ||
| // Filename will be taken from filename inside the path. | ||
| FilePath string `json:"-"` | ||
| FilePaths []string `json:"-"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
почему не хранить всегда []string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это вообще сильно поменяю в следующем коммите, пока можно забить
| package invokerconn | ||
|
|
||
| import ( | ||
| models2 "testing_system/common/db/models" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
почему 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
О, надо пофиксить, там вообще все структуры сломались в какой-то момент и я не везде починил
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
я ничего не понял) какой-то генератор ключа, в cacheKey хранится три штуки, но всегда используются <= 2
что тут вообще происходит
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Дописал пояснение в комментах
|
|
||
| // This will be changed in later commits | ||
|
|
||
| const ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
вообще мне кажется, что можно для "енумов" свои типы делать отдельные, чтобы не передать что-то не то (вот как в storageconn/structs.go)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ага, так и будет в следующем коммите
No description provided.