File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 43
43
#logger.addHandler(sh)
44
44
logger .addHandler (fh )
45
45
46
-
47
46
## (Connexion) Flask app configuration
48
47
49
48
# Serve a custom version of the swagger ui (Jinja2 templates) based on the default one
59
58
app .prog_engine = ProgramEngine .get_instance ()
60
59
app .shutdown_requested = False
61
60
62
-
63
-
64
61
## New API and web application
65
62
66
63
# API v2 is defined in v2.yml and its methods are in api.py
@@ -486,6 +483,16 @@ def run_server():
486
483
CNNManager .get_instance ()
487
484
EventManager .get_instance ("coderbot" )
488
485
486
+ # Programs and Activities databases
487
+ activities = TinyDB ("data/activities.json" )
488
+ activities_collection = activities .search (query .stock == True )
489
+ if len (activities_collection ) == 0 :
490
+ activity = {
491
+ name : "default"
492
+ stock : True
493
+ }
494
+ activities .insert (activity )
495
+
489
496
if app .bot_config .get ('load_at_start' ) and app .bot_config .get ('load_at_start' ):
490
497
prog = app .prog_engine .load (app .bot_config .get ('load_at_start' ))
491
498
prog .execute ()
You can’t perform that action at this time.
0 commit comments