Merge branch '6.8' of https://gitea.onecluster.org/OneTeam/trytondo-sale_opportunity_management into 6.8
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
commit
c3ad43d144
@ -1 +1,2 @@
|
||||
trytond: while true; do trytond -d ${DB_NAME} --dev -v -c $SCRIPT_DIR/trytond.cfg; done
|
||||
trytond: while true; do trytond -d ${DB_NAME} --dev -v -c $SCRIPT_DIR/trytond.cfg; done
|
||||
monitor: python3 $SCRIPT_DIR/dev.py
|
16
.dev/dev.py
16
.dev/dev.py
@ -2,9 +2,12 @@
|
||||
import sys
|
||||
import os
|
||||
import logging
|
||||
import time
|
||||
|
||||
import inotify.adapters
|
||||
|
||||
logging.basicConfig(level=logging.INFO, stream=sys.stderr)
|
||||
|
||||
SRC = os.environ['SRC']
|
||||
MODULE_NAME = os.environ['MODULE_NAME']
|
||||
DB_NAME = os.environ['DB_NAME']
|
||||
@ -18,12 +21,17 @@ def _main():
|
||||
for event in i.event_gen(yield_nones=False):
|
||||
(_, type_names, path, filename) = event
|
||||
(_, ext) = os.path.splitext(filename)
|
||||
if 'IN_CLOSE_WRITE' not in type_names:
|
||||
continue
|
||||
|
||||
if ext in ['.py', '.xml', '.cfg']:
|
||||
if os.system("trytond-admin -d {} -u {}".format(DB_NAME, MODULE_NAME)) != 0:
|
||||
print("fallo trytond-admin", file=sys.stderr)
|
||||
|
||||
logging.info("ACTUALIZADO TRYTOND POR CAMBIO DE ARCHIVO %s", filename)
|
||||
for _ in range(0, 10):
|
||||
if os.system("trytond-admin -d {} -u {}".format(DB_NAME, MODULE_NAME)) != 0:
|
||||
time.sleep(2)
|
||||
logging.error("fallo trytond-admin")
|
||||
else:
|
||||
logging.info("ACTUALIZADO TRYTOND POR CAMBIO DE ARCHIVO %s", filename)
|
||||
break
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
Reference in New Issue
Block a user