We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 63c1b18 commit 7eeffa4Copy full SHA for 7eeffa4
codesigning/gcp-cloudfunc/main.py
@@ -60,7 +60,12 @@ def main(request):
60
with get_lock():
61
queuefile = bucket.blob('queue.json')
62
queue_dict = json.loads(queuefile.download_as_string())
63
- next_file_url = queue_dict['queue'].pop(0)
+ try:
64
+ next_file_url = queue_dict['queue'].pop(0)
65
+ except IndexError:
66
+ # No items in the queue!
67
+ return jsonify('No items in the queue'), 204
68
+
69
queuefile.upload_from_string(json.dumps(queue_dict))
70
71
data = {
0 commit comments