Skip to content

Commit

Permalink
fix: remove global as bad practice
Browse files Browse the repository at this point in the history
  • Loading branch information
fubuloubu committed Sep 20, 2024
1 parent af0e15e commit 0d6ee50
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions bots/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# NOTE: This bot assumes you use a new bot per deployment
sm = StreamManager(os.environ["APEPAY_CONTRACT_ADDRESS"])

global db
# NOTE: You would probably want to index this by network and deployment,
# if you were operating on multiple networks or deployments
db = []
Expand All @@ -20,13 +19,9 @@

@app.on_startup()
async def load_db(_):
global db

for stream in sm.active_streams():
db.append(stream)

db = sorted(db)


@sm.on_stream_created(app)
async def grant_product(stream):
Expand Down

0 comments on commit 0d6ee50

Please sign in to comment.