-
Notifications
You must be signed in to change notification settings - Fork 42
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
Trigger sync without calling sync_api after login #671
Comments
Is this blocked on #652 or can it be done before then? |
correct |
Removing this line means that upon application start, and after logging in, the user doesn't see any sources. I suggest we definitely want to (I'm probably missing something here) |
The idea is to simplify our metadata sync code so that we have a continuous background thread that runs a MetadataSyncJob every X seconds. Currently we call sync_api all over the place and are trying to remove this. Instead when a user logs in, the metadata sync thread should start the background process of making calls to get metadata from the server. When the user logs out we should stop this thread. So it's just one thread, one loop, if the MetadataSyncJob fails it pauses the main and download queues, and keeps trying every X seconds (we may want to ramp down on retries in the future). When it succeeds, it resumes the queues. |
Description
Since we want our background process to sync every 15 seconds or so (exact number of seconds TBD) and for it to be the only area of code that creates a MetadataSyncJob, we will need to remove this line of code:
securedrop-client/securedrop_client/logic.py
Line 336 in 7dc80f8
Instead we should restart the thread that periodically syncs with the server so that a MetadataSyncJob is immediately run. This helps ensure that MetadataSyncJob is only ever created in one place and only one at a time.
The text was updated successfully, but these errors were encountered: