0

I am setting up push task queue on my Google App Engine App with a countdown parameter so it will execute at some point in the future.

However, my countdown parameter can be very large in seconds, for instance months or even a year in the future. Just want to make sure this will not cause any problems or overhead cost? Maybe there is a more efficient way to do this?

Axifive
  • 1,159
  • 2
  • 19
  • 31
JK140
  • 775
  • 2
  • 10
  • 19
  • Use a cron job instead. – new name Apr 29 '17 at 15:44
  • I cannot use a cron job because the datetime I need to execute the tasks will be different for each tasks. Will the countdown parameter be unable to handle very large times? – JK140 Apr 29 '17 at 16:52

2 Answers2

0

It probably would work, but it seems like a bad idea. What do you do if you change your task processing code? You can't modify a task in the queue. You'd somehow have to keep track of the tasks, delete the old ones and replace them with new ones that work with your updated code.

Instead, store information about the tasks in the data store. Run a cron job once a day or once a week, process the info in the data store, and launch the tasks as needed. You can still use a countdown if you need a precise execution date and time.

new name
  • 15,861
  • 19
  • 68
  • 114
0

The current limit in Task Queues is 30 days, and we don't have plans to raise that substantially.

Writing scheduled operations to datastore and running a daily cron job to inject that day's tasks is a good strategy. That would allow you to update the semantics as your product evolves.

nhanssens
  • 76
  • 1