From 3012e61852c5f199b2b7512677106b7f8e3f9ac0 Mon Sep 17 00:00:00 2001 From: Tycho Bellers Date: Wed, 13 Dec 2023 22:47:56 -0800 Subject: [PATCH] Update web config --- .idea/Twitch Drops Notifier.iml | 3 ++- .idea/misc.xml | 2 +- web/app.yaml | 9 ++++++++- web/main.py | 12 ++++++++++++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.idea/Twitch Drops Notifier.iml b/.idea/Twitch Drops Notifier.iml index 756bb9e..8c4d7ca 100644 --- a/.idea/Twitch Drops Notifier.iml +++ b/.idea/Twitch Drops Notifier.iml @@ -8,8 +8,9 @@ + - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 9fb9475..64112d6 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/web/app.yaml b/web/app.yaml index cc0bf8d..599c7fb 100644 --- a/web/app.yaml +++ b/web/app.yaml @@ -10,4 +10,11 @@ handlers: # required when static routes are defined, but can be omitted (along with # the entire handlers section) when there are no static files defined. - url: /.* - script: auto \ No newline at end of file + script: auto + +automatic_scaling: + min_instances: 1 + max_instances: 1 + +inbound_services: + - warmup diff --git a/web/main.py b/web/main.py index 1f63a5e..3d5e95a 100644 --- a/web/main.py +++ b/web/main.py @@ -41,6 +41,18 @@ def get_user(user_id: str) -> Optional[Dict[str, Any]]: return None +@app.route("/_ah/warmup") +def warmup(): + """Served stub function returning no content. + + Your warmup logic can be implemented here (e.g. set up a database connection pool) + + Returns: + An empty string, an HTTP code 200, and an empty object. + """ + return "", 200, {} + + @app.route('/') def index(): # Find user