soxogvv commited on
Commit
8ed08c9
·
verified ·
1 Parent(s): acd6d45

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -24,6 +24,11 @@ db = client.teleg4am_reelssss
24
  a_raw = db.raw_links
25
  a_reacted = db.reacted_links
26
  last_alerts = {"raw": -1, "reacted": -1}
 
 
 
 
 
27
 
28
  # === Flask App ===
29
  app = Flask(__name__)
 
24
  a_raw = db.raw_links
25
  a_reacted = db.reacted_links
26
  last_alerts = {"raw": -1, "reacted": -1}
27
+ # Add indexes to improve performance (run only once on startup)
28
+ a_raw.create_index([("link", 1)], unique=True)
29
+ a_raw.create_index([("used", 1)])
30
+ a_reacted.create_index([("link", 1)], unique=True)
31
+ a_reacted.create_index([("used", 1)])
32
 
33
  # === Flask App ===
34
  app = Flask(__name__)