Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- each poll has open bool, early_results bool and close_date timestamp
- desired behaviours:
- polls should be closed when their close_date occurs
- polls which are closed should have results available
- polls which are open and have early_results should have results available but not necessarily latest
- keep results generation to a minimum, it's not the least intensive procedure
- actions:
- hourly, run a task that closes overrun polls + gens results and gens results for open early_results polls
- when information about a poll is requested, check if it's overrun - close and gen results
- when results are requested from an open early_results poll, serve results if they are in db otherwise gen
- (INFORMATION ABOUT A POLL IS REQUESTED):
- get_poll
- get_results
- (ALL ENDPOINTS):
- /
- /about
- /polls/new - get/post
- /polls/<poll_id> - get/post
- /polls/<poll_id>/results
- /polls/<poll_id>/delete - get/post
- /polls/<poll_id>/delete_by_email - get/post
- /polls/<poll_id>/delete_by_email/<token>
- /search - get/post
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement