K00B404 commited on
Commit
5ecc11a
·
verified ·
1 Parent(s): d03b4aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -30,6 +30,7 @@ def check_db_writable(file_path):
30
 
31
  check_db_writable(db_file_path)
32
 
 
33
  def fetch_logs(file_path):
34
  try:
35
  conn = sqlite3.connect(file_path)
@@ -45,7 +46,6 @@ def fetch_logs(file_path):
45
  except Exception as e:
46
  print(f"Error fetching logs: {e}")
47
 
48
- fetch_logs(db_file_path)
49
 
50
  # Initialize the database
51
  def init_db(file='logs.db'):
@@ -96,6 +96,8 @@ timeout = 100
96
 
97
  init_db()
98
 
 
 
99
  # Set up logging
100
  logging.basicConfig(filename='access.log', level=logging.INFO,
101
  format='%(asctime)s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
 
30
 
31
  check_db_writable(db_file_path)
32
 
33
+
34
  def fetch_logs(file_path):
35
  try:
36
  conn = sqlite3.connect(file_path)
 
46
  except Exception as e:
47
  print(f"Error fetching logs: {e}")
48
 
 
49
 
50
  # Initialize the database
51
  def init_db(file='logs.db'):
 
96
 
97
  init_db()
98
 
99
+ fetch_logs(db_file_path)
100
+
101
  # Set up logging
102
  logging.basicConfig(filename='access.log', level=logging.INFO,
103
  format='%(asctime)s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S')