Skip to content

Commit

Permalink
Update cache.py
Browse files Browse the repository at this point in the history
Had a problem with getting key_statisitic_data from yahoo finance. Trying out different settings in the while loop and made a bigger span for the random.randint function that worked.
  • Loading branch information
bjosun authored Dec 15, 2023
1 parent 2c7cf9c commit b5459b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yahoofinancials/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,15 +348,15 @@ def initialise(self):
self.initialised = 0 # failure
return
i = 0
while i < 150:
while i < 250:
try:
db.connect()
Cookie_db_proxy.initialize(db)
db.create_tables([_CookieSchema])
self.initialised = 1 # success
return
except _peewee.OperationalError:
time.sleep(random.randint(3, 15))
time.sleep(random.randint(3, 25))
continue
self.initialised = 0 # failure

Expand Down

0 comments on commit b5459b2

Please sign in to comment.