Skip to content

Commit 5aa7e55

Browse files
authored
Merge pull request #18 from tblanarik/tblanarik/fix-500
Adds error handling and scheduled cleanup
2 parents 4f9fe9e + fdeeffb commit 5aa7e55

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

function_app.py

+7
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,11 @@ def spotbot(req: func.HttpRequest) -> func.HttpResponse:
1717

1818
@app.route(route="manual_cleanup", methods=[func.HttpMethod.POST])
1919
def manual_cleanup(req: func.HttpRequest) -> func.HttpResponse:
20+
cleanup.cleanup()
21+
return func.HttpResponse(status_code=202)
22+
23+
@app.schedule(schedule="0 0 * * *",
24+
arg_name="timer",
25+
run_on_startup=False)
26+
def timer_cleanup(timer: func.TimerRequest) -> None:
2027
cleanup.cleanup()

0 commit comments

Comments
 (0)