Skip to content

Commit 1243a6e

Browse files
committed
Cleanup
1 parent ed1af5c commit 1243a6e

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

root/app/api.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
api = Flask(__name__)
66

77

8-
@api.route('/health')
8+
@api.route("/health")
99
def health():
10-
return jsonify('Success')
10+
return jsonify("Success")
1111

12-
@api.route('/api/v1/images')
12+
@api.route("/api/v1/images")
1313
def images():
1414
with KeyValueStore() as kv:
1515
return api.response_class(
16-
response=kv['images'],
16+
response=kv["images"],
1717
status=200,
18-
mimetype='application/json'
18+
mimetype="application/json"
1919
)
2020

21-
if __name__ == '__main__':
21+
if __name__ == "__main__":
2222
api.run()

root/app/updater.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,20 @@ def get_state():
5151

5252
def update_images():
5353
with KeyValueStore(invalidate_hours=INVALIDATE_HOURS, readonly=False) as kv:
54-
if 'images' in kv:
55-
print(f'{datetime.datetime.now()} - skipped - already updated')
54+
if "images" in kv:
55+
print(f"{datetime.datetime.now()} - skipped - already updated")
5656
return
57-
print(f'{datetime.datetime.now()} - updating images')
57+
print(f"{datetime.datetime.now()} - updating images")
5858
current_state = get_state()
59-
kv['images'] = json.dumps(current_state)
60-
print(f'{datetime.datetime.now()} - updated images')
59+
kv["images"] = json.dumps(current_state)
60+
print(f"{datetime.datetime.now()} - updated images")
6161

6262
class UpdateImages(threading.Thread):
6363
def run(self,*args,**kwargs):
6464
while True:
6565
update_images()
6666
time.sleep(INVALIDATE_HOURS*60*60)
6767

68-
if __name__ == '__main__':
68+
if __name__ == "__main__":
6969
update_images_thread = UpdateImages()
7070
update_images_thread.start()

0 commit comments

Comments
 (0)