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
Sync queue updates #8342
Sync queue updates #8342
Conversation
…mining if sync is in progress. Add tests for determining sync is in progress behaviour.
Run in finally block to always resync.
e6f41bb
to
b0fe8aa
Compare
Break up check_queue function to reduce cyclomatic complexity.
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.
@@ -118,7 +135,7 @@ def startpeerusersync( | |||
job_data["resync_interval"] = resync_interval | |||
JOB_ID = hashlib.md5("{}::{}".format(server, user).encode()).hexdigest() | |||
job_data["job_id"] = JOB_ID | |||
job = queue.enqueue(call_command, "sync", **job_data) | |||
job = queue.enqueue(peer_sync, **job_data) |
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.
it looks perfect
keep_alive=10, | ||
) | ||
queue = SyncQueue.objects.create(user_id=self.learner.id, keep_alive=10) | ||
time.sleep(1) |
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.
have I ever said how much I hate adding sleep to the tests?... I know this is a bad windows behaviour so one more reason not-to-love that OS
btw, this discussion is related https://stackoverflow.com/questions/85451/pythons-time-clock-vs-time-time-accuracy
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.
Yeah, I am not a huge fan, but it seems like the only way :/
Summary
Reviewer guidance
Do the tests do what they purport?
Does the code do what it ought?
Testing checklist
PR process
Reviewer checklist
yarn
andpip
)