|
|
@@ -25,13 +25,16 @@ print('Skin set version : ' + version_list['s_ver'])
|
|
|
|
|
|
# Init-PIP_Install
|
|
|
data_up_date = 1
|
|
|
-if os.path.exists(os.path.join('data', 'version.json')):
|
|
|
+if os.path.exists(os.path.join('data', 'version.json')):
|
|
|
with open(os.path.join('data', 'version.json'), encoding = 'utf8') as file_data:
|
|
|
data_load_ver = file_data.read()
|
|
|
|
|
|
if data_load_ver == version_list['r_ver']:
|
|
|
data_up_date = 0
|
|
|
|
|
|
+if os.getenv('NAMU_DOCKER') == 'O': # skip update check when run at docker
|
|
|
+ data_up_date = 0
|
|
|
+
|
|
|
if data_up_date == 1:
|
|
|
with open(os.path.join('data', 'version.json'), 'w', encoding = 'utf8') as f:
|
|
|
f.write(version_list['r_ver'])
|
|
|
@@ -259,7 +262,8 @@ class get_db_connect:
|
|
|
|
|
|
self.conn = None
|
|
|
try_cnt = 1
|
|
|
- while (self.conn == None and not (self.conn.open() if self.conn != None else False)) and try_cnt <= 5:
|
|
|
+ max_try = 30
|
|
|
+ while (self.conn == None and not (self.conn.open() if self.conn != None else False)) and try_cnt <= max_try:
|
|
|
try:
|
|
|
if self.init_mode:
|
|
|
self.conn = pymysql.connect(
|
|
|
@@ -281,13 +285,14 @@ class get_db_connect:
|
|
|
db = self.db_set['db_name']
|
|
|
)
|
|
|
except pymysql.err.OperationalError as err:
|
|
|
- if try_cnt + 1 > 5:
|
|
|
+ if try_cnt + 1 > max_try:
|
|
|
raise err
|
|
|
else:
|
|
|
- time.sleep(0.5)
|
|
|
continue
|
|
|
finally:
|
|
|
try_cnt += 1
|
|
|
+ time.sleep(1)
|
|
|
+
|
|
|
|
|
|
if self.conn == None:
|
|
|
raise Exception("Unable to connect database")
|