Browse Source

캐싱 갱신 기능 추가

Surplus_Up (2DU) 6 years ago
parent
commit
02109afa55
3 changed files with 17 additions and 7 deletions
  1. 1 1
      language/ko-KR.json
  2. 15 5
      route/view_read.py
  3. 1 1
      version.json

+ 1 - 1
language/ko-KR.json

@@ -250,7 +250,7 @@
     "waiting_for_approval": "회원가입 신청이 정상적으로 접수됐습니다. 관리자의 승인을 기다려주세요.",
     "ie_no_data_required": "이 기능을 수행하기 위해 필요한 데이터가 제공되지 않았습니다.",
     "port": "포트",
-    "reload": "새로고침",
+    "reload": "갱신",
     "indexing": "DB 인덱싱",
     "topic_state": "토론 상태",
     "watchlist": "주시 목록",

+ 15 - 5
route/view_read.py

@@ -75,11 +75,15 @@ def view_read_2(conn, name):
 
         curs.execute(db_change("select data from history where title = ? and id = ?"), [name, str(num)])
     else:
-        curs.execute(db_change("select data from cache_data where title = ?"), [name])
-        cache_data = curs.fetchall()
-        if not cache_data or cache_data[0][0] == 'HTTP Request 404':
+        if not flask.request.args.get('reload', None):
+            curs.execute(db_change("select data from cache_data where title = ?"), [name])
+            cache_data = curs.fetchall()
+            if not cache_data or cache_data[0][0] == 'HTTP Request 404':
+                curs.execute(db_change("select data from data where title = ?"), [name])
+                
+                cache_data = None
+        else:
             curs.execute(db_change("select data from data where title = ?"), [name])
-            cache_data = None
 
     if cache_data:
         end_data = cache_data[0][0]
@@ -155,7 +159,13 @@ def view_read_2(conn, name):
         else:
             menu = [['edit/' + url_pas(name), load_lang('edit')]]
 
-        menu += [['topic/' + url_pas(name), load_lang('discussion'), topic], ['history/' + url_pas(name), load_lang('history')], ['xref/' + url_pas(name), load_lang('backlink')], ['acl/' + url_pas(name), load_lang('acl'), acl]]
+        menu += [
+            ['topic/' + url_pas(name), load_lang('discussion'), topic], 
+            ['history/' + url_pas(name), load_lang('history')], 
+            ['xref/' + url_pas(name), load_lang('backlink')], 
+            ['acl/' + url_pas(name), load_lang('acl'), acl],
+            ['w/' + url_pas(name) + '?reload=true', load_lang('reload')]
+        ]
 
         if flask.request.args.get('from', None):
             menu += [['w/' + url_pas(name), load_lang('pass')]]

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "master" : {
-        "r_ver" : "v3.1.6-master-22",
+        "r_ver" : "v3.1.6-master-23",
         "c_ver" : "400009",
         "s_ver" : "7"
     }, "stable" : {