Clean up error handling and unnecessary non-flask runner code
authorJacob <jobs@jacobcasper.com>
Sun, 7 Sep 2025 17:57:52 +0000 (12:57 -0500)
committerJacob <jobs@jacobcasper.com>
Sun, 7 Sep 2025 17:57:52 +0000 (12:57 -0500)
main.py

diff --git a/main.py b/main.py
index 1391c546db1041bb006ae431fc6c47f95edcb4b6..aaa84a1646cb0e60b229fd7b3e14318fc8759d61 100644 (file)
--- a/main.py
+++ b/main.py
@@ -23,6 +23,7 @@ def stats():
         return Response("Internal Server Error", 500)
     except Exception as e:
         app.logger.exception(e)
+        return "Internal Server Error", 500
     return {}
 
 
@@ -51,11 +52,3 @@ def api(subpath):
     # TODO check that the subpath contains no more than 3 unique subpath strings
     hits = r.incr(f"hits:{subpath}")
     return {"hits": hits}
-
-
-def main():
-    app.run()
-
-
-if __name__ == "__main__":
-    main()