File tree 2 files changed +2
-24
lines changed
2 files changed +2
-24
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- import logging
2
1
import azure .functions as func
3
2
import spotbot as sb
4
- import cleanup
5
3
6
4
app = func .FunctionApp (http_auth_level = func .AuthLevel .FUNCTION )
7
5
8
6
@app .route (route = "spotbot" , methods = [func .HttpMethod .POST ])
9
7
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 )
You can’t perform that action at this time.
0 commit comments