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:
parent
57d6f6305c
commit
3f614a1497
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue