37 lines
661 B
Python
37 lines
661 B
Python
from migration.alembic_scipt import auto_lookup
|
|
import time
|
|
import logging
|
|
import auth.api_security as auth
|
|
import os
|
|
|
|
#Logging
|
|
|
|
logging.basicConfig(
|
|
filename='app.log', # Log to a file
|
|
level=logging.DEBUG, # Log everything (DEBUG and above)
|
|
format='%(asctime)s %(levelname)s %(message)s'
|
|
)
|
|
|
|
logging.info('Application started')
|
|
try:
|
|
logging.debug('Debug info here')
|
|
except Exception as e:
|
|
logging.exception('An error occurred')
|
|
|
|
|
|
def new_table():
|
|
auto_lookup()
|
|
|
|
def admin():
|
|
token = auth.admin_token()
|
|
print(token)
|
|
logging.info(token)
|
|
time.sleep(300)
|
|
os.remove("app.log")
|
|
os._exit(1)
|
|
|
|
|
|
new_table()
|
|
admin()
|
|
|