From bda3efc7dfb9d5dbcd9e35dd0a484bbbf95ec334 Mon Sep 17 00:00:00 2001 From: KWON Date: Mon, 21 Jul 2025 17:33:43 +0900 Subject: [PATCH] =?UTF-8?q?./lib/weather=5Fasos.py=20./lib/ga4.py=20./lib/?= =?UTF-8?q?air=5Fquality.py=20=EA=B0=81=20=ED=8C=8C=EC=9D=BC=EC=9D=84=20?= =?UTF-8?q?=EB=AA=A8=EB=91=90=20=ED=95=9C=EB=B2=88=EC=94=A9=20=EC=8B=A4?= =?UTF-8?q?=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- daily_run.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 daily_run.py diff --git a/daily_run.py b/daily_run.py new file mode 100644 index 0000000..d2556e9 --- /dev/null +++ b/daily_run.py @@ -0,0 +1,43 @@ +# ./lib/weather_asos.py +# ./lib/ga4.py +# ./lib/air_quality.py +# 각 파일을 모두 한번씩 실행 +# daily_run.py + +import os +import sys + +# lib 디렉토리를 path에 추가 +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib'))) +from conf import db, db_schema + +def run_weather(): + try: + from weather_asos import main as weather_main + print("\n[RUNNING] weather_asos.py") + weather_main() + except Exception as e: + print(f"[ERROR] weather_asos 실행 실패: {e}") + +def run_ga4(): + try: + from ga4 import main as ga4_main + print("\n[RUNNING] ga4.py") + ga4_main() + except Exception as e: + print(f"[ERROR] ga4 실행 실패: {e}") + +def run_air_quality(): + try: + from air_quality import AirQualityCollector + print("\n[RUNNING] air_quality.py") + config = db.load_config() + collector = AirQualityCollector(config, db.engine, db_schema.air) + collector.run() + except Exception as e: + print(f"[ERROR] air_quality 실행 실패: {e}") + +if __name__ == "__main__": + run_weather() + run_ga4() + run_air_quality()