File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ StartLimitBurst=5
66
77[Service]
88Restart =on-failure
9- RestartSec =20s
9+ RestartSec =20
1010TimeoutSec =0
1111ExecStart =/opt/Mycodo/env/bin/python /opt/Mycodo/mycodo/mycodo_daemon.py
1212ExecStop =/opt/Mycodo/env/bin/python /opt/Mycodo/mycodo/mycodo_client.py -t
Original file line number Diff line number Diff line change 11[Unit]
22Description =Mycodo web user interface
33After =network.target
4+ StartLimitIntervalSec =300
5+ StartLimitBurst =5
46
57[Service]
8+ Restart =on-failure
9+ RestartSec =20
610User =root
711Group =mycodo
812WorkingDirectory =/opt/Mycodo/mycodo
Original file line number Diff line number Diff line change @@ -16,7 +16,15 @@ def session_scope(db_uri):
1616 Session = sessionmaker ()
1717
1818 # later, we create the engine
19- engine = create_engine (f"{ db_uri } ?check_same_thread=False" )
19+ try :
20+ # Custom URI
21+ from mycodo .config_override import SQLALCHEMY_DATABASE_URI
22+ engine_url = SQLALCHEMY_DATABASE_URI
23+ except :
24+ # SQLite3
25+ engine_url = f"{ db_uri } ?check_same_thread=False"
26+
27+ engine = create_engine (engine_url )
2028
2129 # associate it with our custom Session class
2230 Session .configure (bind = engine )
You can’t perform that action at this time.
0 commit comments