Tivix / django-cron

Write cron business logic as a Python class and let this app do the rest! It enables Django projects to schedule cron tasks, tracks their success / failures, manages contention (via a cache) etc. Basically takes care of all the boring work for you :-)
www.tivix.com
MIT License
900 stars 193 forks source link

Can't create or update object #105

Closed quevon24 closed 6 years ago

quevon24 commented 7 years ago

Hi, I was wondering if it's possible to create or update an object inside a cron job function? Because I tried but without success. The execution stops at the create() or update() line without any error. It's possible to update an object using save() but not to create it. Thanks.

tab-cmd commented 7 years ago

@quevon24 I need more information. The quick answer based on what I can understand is yes. Can you post your cron job, describe exactly what you are trying to create, and any errors you get? Thanks!

AnthonyJCalabro commented 6 years ago

Im also coming across a similar issue.

Im running Django with a postgresql database and for some reason cron tasks will stop execution as soon as I attempt to update a model.

maxim-kht commented 6 years ago

Hi @AnthonyJCalabro could you please paste the message from CronJobLog? It can be retrieved in admin or Django shell.

AnthonyJCalabro commented 6 years ago

Hi @maxim-kht thankyou for the quick reply.

I checked the message and the error was a mistake on my end.

I was using:

datetime.now()

Instead of datetime.datetime.now()

Thankyou for the help regardless