Kaynağa Gözat

SQLite에서도 1시간 루프 돌도록

Surplus_Up (2DU) 6 yıl önce
ebeveyn
işleme
4d62f127bc
1 değiştirilmiş dosya ile 7 ekleme ve 9 silme
  1. 7 9
      app.py

+ 7 - 9
app.py

@@ -309,17 +309,15 @@ if set_data['db_type'] == 'sqlite':
     else:
         print('Back up state : Turn off')
 
-if set_data['db_type'] == 'mysql':
-    def mysql_dont_off():
-        try:
-            urllib.request.urlopen('http://localhost:' + server_set['port'] + '/')
-        except:
-            pass
-
-        threading.Timer(60 * 60 * 6, mysql_dont_off).start()
+def mysql_dont_off():
+    try:
+        urllib.request.urlopen('http://localhost:' + server_set['port'] + '/')
+    except:
+        pass
 
-    mysql_dont_off()
+    threading.Timer(60 * 60 * 6, mysql_dont_off).start()
 
+mysql_dont_off()
 
 curs.execute(db_change('select data from other where name = "count_all_title"'))
 if not curs.fetchall():