Skip to content

Commit 7447ced

Browse files
authored
Revert "Error handling and stubbing out table cleanup methods"
1 parent c04ab4d commit 7447ced

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

cleanup.py

-4
This file was deleted.

function_app.py

+2-20
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,9 @@
1-
import logging
21
import azure.functions as func
32
import spotbot as sb
4-
import cleanup
53

64
app = func.FunctionApp(http_auth_level=func.AuthLevel.FUNCTION)
75

86
@app.route(route="spotbot", methods=[func.HttpMethod.POST])
97
def spotbot(req: func.HttpRequest) -> func.HttpResponse:
10-
try:
11-
sb.run(req)
12-
except Exception as _excpt:
13-
logging.error(f"Exception occurred: {_excpt}")
14-
return func.HttpResponse(body=f"Exception occurred: {_excpt}", status_code=500)
15-
else:
16-
return func.HttpResponse(status_code=202)
17-
18-
@app.function_name(name="tablecleanup")
19-
@app.schedule(schedule="0 8 * * *",
20-
arg_name="tablecleanup",
21-
run_on_startup=False)
22-
def table_cleanup(timer: func.TimerRequest) -> None:
23-
cleanup.cleanup()
24-
25-
@app.route(route="manualcleanup", methods=[func.HttpMethod.POST])
26-
def manual_cleanup(req: func.HttpRequest) -> func.HttpResponse:
27-
cleanup.cleanup()
8+
sb.run(req)
9+
return func.HttpResponse(status_code=202)

0 commit comments

Comments
 (0)