-
Notifications
You must be signed in to change notification settings - Fork 22
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
Refactor handler and tasks to use the same struct #104
Comments
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: