You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In all the funcs inside tasks/tasks.go, the variables tsbridge.MetricConfig, tsbridge.Metrics, tsbridge.Config and storage.Manager are required repeatedly. Instead of passing them every time, a struct could be made to store these values. This would make the function calls much cleaner to read.
There is already a struct named web.Handler which stores these values, so the code should be refactored to use the same struct in both handlers.go and tasks.go. Currently, handlers.go is only used for AppEngine, whereas tasks.go functions are used in both AppEngine and non-AppEngine cases. This must be accounted for when refactoring.
The text was updated successfully, but these errors were encountered:
SoapHia
changed the title
Refactor AppEngine and syncLoop tasks to use the same struct
Refactor AppEngine and tasks to use the same struct
Feb 15, 2021
SoapHia
changed the title
Refactor AppEngine and tasks to use the same struct
Refactor handler and tasks to use the same struct
Feb 15, 2021
In all the funcs inside
tasks/tasks.go
, the variablestsbridge.MetricConfig
,tsbridge.Metrics
,tsbridge.Config
andstorage.Manager
are required repeatedly. Instead of passing them every time, a struct could be made to store these values. This would make the function calls much cleaner to read.There is already a struct named
web.Handler
which stores these values, so the code should be refactored to use the same struct in bothhandlers.go
andtasks.go
. Currently,handlers.go
is only used for AppEngine, whereastasks.go
functions are used in both AppEngine and non-AppEngine cases. This must be accounted for when refactoring.See also: post by @nerdinary in #103 (comment)
The text was updated successfully, but these errors were encountered: