File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/main/java/com/fund/stockProject/global/scheduler Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,10 @@ public class StockUpdateScheduler {
1818 private final StockImportService stockImportService ;
1919
2020 /**
21- * 매주 월요일 새벽 3시에 종목 마스터 데이터 업데이트
21+ * 매주 화요일 새벽 3시에 종목 마스터 데이터 업데이트
2222 * Python 스크립트를 실행하여 최신 종목 데이터를 수집하고 DB에 반영합니다.
2323 */
24- @ Scheduled (cron = "0 0 3 * * MON " , zone = "Asia/Seoul" ) // 매주 월요일 3시 실행
24+ @ Scheduled (cron = "0 0 3 * * TUE " , zone = "Asia/Seoul" ) // 매주 화요일 3시 실행
2525 public void updateStockMaster () {
2626 log .info ("Starting weekly stock master update scheduler" );
2727
@@ -42,9 +42,12 @@ public void updateStockMaster() {
4242 }
4343
4444 log .info ("Executing Python script: {}" , scriptPath );
45- ProcessBuilder processBuilder = new ProcessBuilder ( "python3" , scriptPath );
46- // 스크립트가 있는 디렉토리를 작업 디렉토리로 설정
45+ // 스크립트 파일명만 사용 (작업 디렉토리를 스크립트 디렉토리로 설정하므로)
46+ String scriptFileName = scriptFile . getName ();
4747 File scriptDir = scriptFile .getParentFile ();
48+
49+ ProcessBuilder processBuilder = new ProcessBuilder ("python3" , scriptFileName );
50+ // 스크립트가 있는 디렉토리를 작업 디렉토리로 설정
4851 processBuilder .directory (scriptDir != null ? scriptDir : new File ("." ));
4952 processBuilder .redirectErrorStream (true );
5053
You can’t perform that action at this time.
0 commit comments