Skip to content

Commit

Permalink
delete older data
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfagun74 committed May 8, 2024
1 parent 8052c20 commit 25879ea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,13 @@ def log_request(response):
return response

if __name__ == "__main__":

#Migrations
cursor.execute('''DROP TABLE IF EXISTS games''')
cursor.execute('''DROP TABLE IF EXISTS games_v2''')
cursor.execute('''DELETE FROM cache WHERE timestamp > 1715207330''')

#Init
cursor.execute('''CREATE TABLE IF NOT EXISTS cache (url TEXT PRIMARY KEY, data TEXT, timestamp REAL)''')
cursor.execute('''CREATE TABLE IF NOT EXISTS stats (stat TEXT PRIMARY KEY, count INTEGER)''')
cursor.execute('''CREATE INDEX IF NOT EXISTS idx_url ON cache (url)''')
Expand Down

0 comments on commit 25879ea

Please sign in to comment.