Skip to content
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

Merged
merged 3 commits into from
Mar 31, 2020
Merged

Conversation

jemshid
Copy link
Contributor

@jemshid jemshid commented Mar 26, 2020

#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

@jemshid jemshid added bug Something isn't working enhancement New feature or request labels Mar 26, 2020
while job is not None:
log.info("Canceling " + str(job))
job.cancel()
job.delete()
job = q.dequeue()
job = q.delete()
Copy link
Contributor

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?

Copy link
Contributor Author

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:
Copy link
Contributor

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

Copy link
Contributor Author

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:
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, makes sense

Copy link
Contributor

@pbattu123 pbattu123 left a 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.

@pbattu123 pbattu123 merged commit 6015d44 into peerplays-network:develop Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

worker startup fails at times yaml.laod() deprecated JobTimeoutException when trying to approve proposals
3 participants