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.
add: Round service #48
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
base: main
Are you sure you want to change the base?
add: Round service #48
Changes from all commits
d29133e
11eee5a
7e0a4e2
91fa889
bf300bf
538a697
0617456
fb6591a
85b80e0
c581ec7
348e3bb
639783f
f1329c2
2cac5a0
f073bc6
e9f6bfe
c5d9c11
1a37ac2
5cfe64e
5a3085d
4b15395
a93dd4c
3cf95d7
1ff9a62
8a1fe17
a37eb0b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can this be inferred from
lib/config.js
? Something liketype RoundConfig = typeof config.roundServiceConfig
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.
why is this key not private as well?
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 code is repeated in
#initializeRound()
can we refactor into a function#maybeStartNewRound()
?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.
What is the purpose of the
active
field? Can we simplify this to querying what is the last round where end_time > NOW()?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.
Motivation behind the
active
field was to switch on round toactive
after the task creation. Unlike the implementation in thespark-api
where tasks are created during the round creation on the database level, here we callTaskingService
to create tasks for the round.Thing that I'm questioning is should we or should we not leave the last round as active in case the
TaskingService
fails to sample / insert tasks for the new round?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.
Got it, you can only consider the round active once tasks have been sampled, but you can also only sample tasks once the round exists, right?
Can we then rename
active
tohas_had_tasks_defined
? This way the purpose to me is more clear. Another way is toJOIN
on the tasks for that round, and simply consider any round as inactive if it has no matching tasks. This assumes we don't want to have empty rounds.