Migrated Workflows From In Memory to Db #33
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a constant error with no table found error. See issue: bugs when use attach database mattn/go-sqlite3#511
Had to make a change for dev environment since appearently in memory sqlite creates a new in memory db instance when creating a new connection. I haven't run into issues testing the web app and running the integrations tests but I think it's important to keep that in mind.
Right now I'm polling the enabled workflows from database in 100ms intervals.
Changing defer in GcSessions sped up the integration test by a second since it closed connection earlier(was getting errors in session, so had to tinker with it a lot.)
Some Additional Footnotes
For example in services/workflow.go:
Haven't made changes about this yet but when for example creating a workflow, we're returning a generic internal server error if there's no topic in database with that particular name. Shouldn't we specify messages a little bit, but to at what extend. Should I create an error saying that in service layer and catch and serve that error to the user or
Log that error but give a generic error message that it can't be created with bad request instead of server error?