Cron Tasks, Task Queue or Pending Tasks?

In the Google App Engine, for a task such as scanning some RSS feeds and adding new entries from the feed to the data warehouse every 10-15 seconds , should you use Cron Jobs , Task Queue or Delayed Tasks ? I'm really confused.

+3
source share
2 answers

Run the cron job every 1 minute to get RSSand sleep for 15 seconds four times. You can block to prevent overlapping (although inserting a database provides some measure of concurrency control).

Pit-like pseudo-code:

if cant_get_lock:
    exit
else:
for i in (1,2,3,4):
    get RSS
    sleep 15 seconds
0
source
  • I think if this happens every 15 seconds (without skipping), than I would like to work cron because it is the easiest way to implement. But if you need to be able to cancel the task, then you must use the queue task.
  • BTW you must use PubSubHubbub (hubbub) to receive live feed updates for channels if I understand you correctly.
0
source

Source: https://habr.com/ru/post/1778401/


All Articles