Skip to content
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

Don't close sync session unless also older than cutoff #205

Merged
merged 3 commits into from
Nov 14, 2023

Conversation

bjester
Copy link
Member

@bjester bjester commented Nov 14, 2023

Summary

In order to support sync resumption and automated clean up of incomplete transfers for Kolibri's learn-only device syncing, the command needs to also filter the sync sessions to only those that have been inactive for at least the expiration amount of time

  • Fixes issue in iterating over sync sessions
  • Adds last_activity_timestamp filter to sync sessions before iterating to clean them up

TODO

  • Have tests been written for the new code?
  • Has documentation been written/updated?
  • New dependencies (if any) added to requirements file

Reviewer guidance

Do the tests make sense

Issues addressed

Fixes #183

Documentation

If the PR has documentation, link the file here (either .rst in your repo or if built on Read The Docs)

Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes make sense to me!

@@ -97,8 +98,7 @@ def handle(self, *args, **options):
transfer_count = transfer_sessions.count()

# loop over the stale sessions one by one to close them out
for i in range(transfer_count):
transfer_session = transfer_sessions[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, so this and below was only ever affecting the first transfer/sync session!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I think this was operating as expected. The sync session one though had the problem.

@bjester bjester merged commit fb1a67b into learningequality:release-v0.6.x Nov 14, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants