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

This commit is contained in:
Camilo Gonzalez 2023-08-15 22:33:09 -05:00
commit c3ad43d144
2 changed files with 14 additions and 5 deletions

View File

@ -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

View File

@ -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__':