-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues #12, #16, #17 #18
Conversation
while job is not None: | ||
log.info("Canceling " + str(job)) | ||
job.cancel() | ||
job.delete() | ||
job = q.dequeue() | ||
job = q.delete() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the purpose is to cancel and delete one by one from the list. Could you delete everything without cancel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
q doesn't have a method dequeue associated with it and things worked well with delete.
# Terminate loop and return midway if bmg creation took time. | ||
# So that incident is processed later. | ||
toc = time.time() - tic | ||
if toc > 30: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any criteria for selecting 30 secs over here, levee a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If timeout is less than 30, a soccer event and all it's betting markets creation takes more than two attempts. With 30 or more number of attempts is 2, which is the lowest possible. Any attempt to get a soccer event created with single attempt consumes about 12 minutes if time out removed. Hence taking take into consideration soccer events, 30 seconds is an optimal timout for bmg creation.
log.debug( | ||
"Updating Betting Market {} ...".format(bm["description"].get("en")) | ||
) | ||
bm.update() | ||
# break the loop and return midway if bm creation takes time. | ||
toc = time.time() | ||
if (toc - tic) > 10: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any criteria for selecting 30 secs over here, levee a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is decided based on soccer events. For soccer, the first bmg has six bms. There are cases where sometimes creation of one bm takes about 30 seconds, that an rq time out is reached before the bmg for loop timeout. It's natural to take about 3 seconds for creation of a bm and 30 seconds is not acceptable. Decided somewhere in the middle, 10 seconds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes looks good to me, but it has to be tested with 60 to 70 soccer events replay to figure out the handling of queue and approval process.
#12 Approval pending map issue, Job time out solved.
Job time for soccer reduced to less than a minute from 12 minutes.
#16 yaml.safe_load
#17 job.dequeue replace with job.delete