|
@@ -403,15 +403,6 @@ if __name__ == "__main__" :
|
|
|
while True:
|
|
|
now = datetime.now()
|
|
|
if now.hour == 1 and now.minute <= 15:
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- conn = pymssql.connect(host = targetDBIP, user = targetDBUserID, password = targetDBUserPW, database = targetDBName, autocommit=True)
|
|
|
-
|
|
|
- cursor = conn.cursor()
|
|
|
- cursor.execute("DELETE " + targetDBName + ".dbo.BemsMonitoringPointWeatherForecasted where SiteId = 1 and BaseDateTime ='" +(now - timedelta(days=2)).strftime('%Y-%m-%d 01:00:00') + "' and ForecastedDateTime >= '" + (now - timedelta(days=1)).strftime('%Y-%m-%d 00:00:00') + "' order by CreatedDateTime desc")
|
|
|
- conn.close()
|
|
|
-
|
|
|
Check_Restoring_Unknown_past_data(targetDBIP, targetDBUserID, targetDBUserPW, targetDBName, nx, ny)
|
|
|
if now.hour == 20 and now.minute >= 45 and now.minute <= 59:
|
|
|
AccumulationActive = True
|
|
@@ -433,6 +424,11 @@ if __name__ == "__main__" :
|
|
|
|
|
|
cursor = conn.cursor()
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ cursor.execute("DELETE " + targetDBName + ".dbo.BemsMonitoringPointWeatherForecasted where SiteId = 1 and BaseDateTime ='" +(now - timedelta(days=2)).strftime('%Y-%m-%d 01:00:00') + "' and ForecastedDateTime >= '" + (now - timedelta(days=1)).strftime('%Y-%m-%d 00:00:00') + "' ")
|
|
|
+
|
|
|
+
|
|
|
for i in range(1, len(TempWF)):
|
|
|
baseDate = TempWF[i][0]
|
|
|
baseTime = TempWF[i][1]
|