Update episode list in 500ms intervals instead 20ms.

The UI is still responsive while performing more work per interval and
updating the list in 90% of the time.
This commit is contained in:
auouymous 2022-09-27 06:28:00 -06:00
parent 57d6f6305c
commit 3f614a1497
1 changed files with 2 additions and 2 deletions

View File

@ -146,8 +146,8 @@ class BackgroundUpdate(object):
model.set(it, *(base_fields + update_fields))
self.index += 1
# Check for the time limit of 20 ms after each 50 rows processed
if self.index % 50 == 0 and (time.time() - started) > 0.02:
# Check for the time limit of 500ms after each 50 rows processed
if self.index % 50 == 0 and (time.time() - started) > 0.5:
break
return bool(self.episodes)