윤영준 윤영준 05-27
hourly update code
@9108507ea5b3bca0945212a6300cb75915bfcfb0
 
DB/postgresql-42.7.3.jar (Binary) (added)
+++ DB/postgresql-42.7.3.jar
Binary file is not shown
Hourly_db_schedular.py
--- Hourly_db_schedular.py
+++ Hourly_db_schedular.py
@@ -66,6 +66,7 @@
             INSERT INTO flooding_anals_event_data_hr (clct_dt, eqpmn_id, flooding_cnt)
             VALUES (%s, %s, %s);
             """
+
             for index, row in df.iterrows():
                 cursor.execute(insert_sql, (previous_hour, row['eqpmn_id'], row['flooding_cnt']))
         conn.commit()
@@ -80,5 +81,6 @@
     return "Flooding analysis service running."
 
 if __name__ == '__main__':
+    fetch_and_update()
     app.run(debug=True, use_reloader=False)
 
config_files/MAIN_DB_ENDPOINT.json
--- config_files/MAIN_DB_ENDPOINT.json
+++ config_files/MAIN_DB_ENDPOINT.json
@@ -1,7 +1,7 @@
 {
-  "address" : "210.180.118.83",
-  "port" : "5423",
-  "id" : "takensoft",
-  "password" : "tts96314728!@",
-  "schema_name" : "ai_camera_v0_1",
+  "host" : "210.180.118.83",
+  "port" : "5432",
+  "dbname" : "ai_camera_management_system",
+  "user" : "takensoft",
+  "password" : "tts96314728!@"
 }
(파일 끝에 줄바꿈 문자 없음)
Add a comment
List