Skip to content
Snippets Groups Projects
Commit da5fdba8 authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

_scheduler/jobs/cleanupjob.py: Update cache size while processing

Updates the known cache size in the main process while the cleanup
process is ongoing, so that the status indicators update live
while the cleanup happens.
parent a80bf9f6
No related branches found
No related tags found
No related merge requests found
Pipeline #44371668 failed
......@@ -28,7 +28,18 @@ class CleanupJob(Job):
self._artifacts = context.artifactcache
def child_process(self):
return self._artifacts.clean()
def progress():
self.send_message('update-cache-size',
self._artifacts.get_cache_size())
return self._artifacts.clean(progress)
def handle_message(self, message_type, message):
# Update the cache size in the main process as we go,
# this provides better feedback in the UI.
if message_type == 'update-cache-size':
self._artifacts.set_cache_size(message)
return True
def parent_complete(self, status, result):
if status == JobStatus.OK:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment