From d6ecf5cbcac7ee13d18a68d4321f3ee14c6ac87f Mon Sep 17 00:00:00 2001 From: Israel Figueroa Date: Sun, 10 Mar 2024 02:14:07 -0300 Subject: [PATCH] fix --- background_gtfs.py | 15 +++++++-------- docker-compose.sample.yaml | 1 + 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/background_gtfs.py b/background_gtfs.py index b35d6ce..1db3119 100644 --- a/background_gtfs.py +++ b/background_gtfs.py @@ -3,17 +3,16 @@ import logging import os import time +def procesa_zip(): + import subprocess + cmd = subprocess.Popen([u"/usr/bin/python /srv/project/manage.py procesa_zip"], shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + cmd.wait() + return (cmd.stdout, cmd.stderr) + + if __name__ == '__main__': while True: o, e = procesa_zip() print(o) print(e) time.sleep(os.environ.get('INTERVAL')) - - - -def procesa_zip(): - import subprocess - cmd = subprocess.Popen([u"/usr/bin/python /srv/project/manage.py procesa_zip"], shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - cmd.wait() - return (cmd.stdout, cmd.stderr) diff --git a/docker-compose.sample.yaml b/docker-compose.sample.yaml index f083505..7282037 100644 --- a/docker-compose.sample.yaml +++ b/docker-compose.sample.yaml @@ -114,6 +114,7 @@ services: - DBSCHEMA=desarrollo1 - DBUSER=postgres - DBPASS=password + - INTERVAL=60 tdtp-proto: build: