fix: DEV-1904: Fixed source storage duplicating tasks when double click Sync button
Description of the proposed changes
Users are being able to click sync button as many times as they want.
In order to avoid running multiple sync jobs at the same time, as a first approach, we have decided to implement a method which checks if there is a sync job already in the queue for that specific project before start the sync.
Jira Ticket
https://heartex.atlassian.net/browse/DEV-1904
✅ Linked to Bug DEV-1904 · Source storage duplicated tasks when double click Sync button
➡️ Part of Epic DEV-3239 · Customer Issues - Q3 Sprint 4
Codecov Report
Base: 77.42% // Head: 77.36% // Decreases project coverage by -0.06% :warning:
Coverage data is based on head (
158b878) compared to base (572d0e7). Patch has no changes to coverable lines.
Additional details and impacted files
@@ Coverage Diff @@
## develop #2915 +/- ##
===========================================
- Coverage 77.42% 77.36% -0.07%
===========================================
Files 146 146
Lines 10775 10791 +16
===========================================
+ Hits 8343 8348 +5
- Misses 2432 2443 +11
| Impacted Files | Coverage Δ | |
|---|---|---|
| label_studio/label_studio/core/redis.py | 42.10% <0.00%> (-1.84%) |
:arrow_down: |
| ...bel_studio/label_studio/io_storages/base_models.py | 79.41% <0.00%> (-1.40%) |
:arrow_down: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
I would add simple test here where sync is called twice.