Closes WikiDeck/wikideck#6
This commit is contained in:
parent
8061fdba9b
commit
ea639eeac1
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
venv/*
|
||||
mine_data/*
|
||||
mariadb_data/*
|
||||
*.pem
|
||||
*__pycache__*
|
||||
|
||||
3
client-requirements.txt
Normal file
3
client-requirements.txt
Normal file
@ -0,0 +1,3 @@
|
||||
cryptography
|
||||
dotenv
|
||||
wikipedia
|
||||
@ -1,5 +1,6 @@
|
||||
import base64
|
||||
import datetime
|
||||
import logging
|
||||
import mariadb
|
||||
import os
|
||||
import time
|
||||
@ -181,6 +182,8 @@ class Database():
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
logging.basicConfig(filename=os.getenv('MINE_LOG_FILE', '/var/log/mine.log'), level=logging.INFO)
|
||||
self.logger = logging.getLogger(__name__)
|
||||
delay = 2
|
||||
while True:
|
||||
try:
|
||||
@ -195,6 +198,7 @@ class Database():
|
||||
for each in self.SQL_CREATE_TABLES:
|
||||
self.conn.cursor().execute(each)
|
||||
except mariadb.Error as e:
|
||||
self.logger.error(e)
|
||||
time.sleep(delay := delay**2)
|
||||
continue
|
||||
break
|
||||
|
||||
Loading…
Reference in New Issue
Block a user