Przeglądaj źródła

전체 문서 수는 그냥 바로 갱신되도록 변경

잉여개발기 (SPDV) 2 lat temu
rodzic
commit
32656ff0fe
3 zmienionych plików z 10 dodań i 12 usunięć
  1. 0 11
      app.py
  2. 9 0
      route/tool/func.py
  3. 1 1
      version.json

+ 0 - 11
app.py

@@ -318,17 +318,6 @@ def do_every_day():
             
             
             curs.execute(db_change("delete from re_admin where time < ?"), [time_calc])
             curs.execute(db_change("delete from re_admin where time < ?"), [time_calc])
 
 
-        # 전체 문서 수 재계산
-        curs.execute(db_change("select count(*) from data"))
-        count_data = curs.fetchall()
-        if count_data:
-            count_data = count_data[0][0]
-        else:
-            count_data = 0
-
-        curs.execute(db_change('delete from other where name = "count_all_title"'))
-        curs.execute(db_change('insert into other (name, data, coverage) values ("count_all_title", ?, "")'), [str(count_data)])
-
         # 사이트맵 생성 관리
         # 사이트맵 생성 관리
         curs.execute(db_change('select data from other where name = "sitemap_auto_make"'))
         curs.execute(db_change('select data from other where name = "sitemap_auto_make"'))
         db_data = curs.fetchall()
         db_data = curs.fetchall()

+ 9 - 0
route/tool/func.py

@@ -2509,10 +2509,19 @@ def history_plus(conn, title, data, date, ip, send, leng, t_check = '', mode = '
 
 
     if mode != 'add' and mode != 'setting' and mode != 'user':
     if mode != 'add' and mode != 'setting' and mode != 'user':
         history_plus_rc_max(conn, 'normal')
         history_plus_rc_max(conn, 'normal')
+
         curs.execute(db_change("insert into rc (id, title, date, type) values (?, ?, ?, 'normal')"), [id_data, title, date])
         curs.execute(db_change("insert into rc (id, title, date, type) values (?, ?, ?, 'normal')"), [id_data, title, date])
     
     
     if mode != 'add' and mode != 'setting':
     if mode != 'add' and mode != 'setting':
         history_plus_rc_max(conn, mode)
         history_plus_rc_max(conn, mode)
+
+        curs.execute(db_change("select count(*) from data"))
+        count_data = curs.fetchall()
+        count_data = count_data[0][0] if count_data else 0
+
+        curs.execute(db_change('delete from other where name = "count_all_title"'))
+        curs.execute(db_change('insert into other (name, data, coverage) values ("count_all_title", ?, "")'), [str(count_data)])
+
         curs.execute(db_change("insert into rc (id, title, date, type) values (?, ?, ?, ?)"), [id_data, title, date, mode])
         curs.execute(db_change("insert into rc (id, title, date, type) values (?, ?, ?, ?)"), [id_data, title, date, mode])
 
 
         data_set_exist = '' if mode != 'delete' else 'not_exist'
         data_set_exist = '' if mode != 'delete' else 'not_exist'

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
 {
     "beta" : {
     "beta" : {
-        "r_ver" : "v3.5.0-dev61",
+        "r_ver" : "v3.5.0-dev62",
         "c_ver" : "3500376",
         "c_ver" : "3500376",
         "s_ver" : "3500113"
         "s_ver" : "3500113"
     }
     }