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 4343#logger.addHandler(sh)
4444logger .addHandler (fh )
4545
46-
4746## (Connexion) Flask app configuration
4847
4948# Serve a custom version of the swagger ui (Jinja2 templates) based on the default one
5958app .prog_engine = ProgramEngine .get_instance ()
6059app .shutdown_requested = False
6160
62-
63-
6461## New API and web application
6562
6663# API v2 is defined in v2.yml and its methods are in api.py
@@ -486,6 +483,16 @@ def run_server():
486483 CNNManager .get_instance ()
487484 EventManager .get_instance ("coderbot" )
488485
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+
489496 if app .bot_config .get ('load_at_start' ) and app .bot_config .get ('load_at_start' ):
490497 prog = app .prog_engine .load (app .bot_config .get ('load_at_start' ))
491498 prog .execute ()
You can’t perform that action at this time.
0 commit comments