This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -140,14 +140,37 @@ def has_completed_background_updates(self):
140
140
"background_updates" ,
141
141
keyvalues = None ,
142
142
retcol = "1" ,
143
- desc = "check_background_updates " ,
143
+ desc = "has_completed_background_updates " ,
144
144
)
145
145
if not updates :
146
146
self ._all_done = True
147
147
return True
148
148
149
149
return False
150
150
151
+ async def has_completed_background_update (self , update_name ):
152
+ """Check if the given background update has finished running.
153
+
154
+ Returns:
155
+ Deferred[bool]
156
+ """
157
+
158
+ if self ._all_done :
159
+ return True
160
+
161
+ if update_name in self ._background_update_queue :
162
+ return False
163
+
164
+ update_exists = await self ._simple_select_one_onecol (
165
+ "background_updates" ,
166
+ keyvalues = {"update_name" : update_name },
167
+ retcol = "1" ,
168
+ desc = "has_completed_background_update" ,
169
+ allow_none = True ,
170
+ )
171
+
172
+ return not update_exists
173
+
151
174
@defer .inlineCallbacks
152
175
def do_next_background_update (self , desired_duration_ms ):
153
176
"""Does some amount of work on the next queued background update
You can’t perform that action at this time.
0 commit comments