Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Pull Request: logging to message #18

Closed
russian-master opened this Issue Mar 22, 2013 · 2 comments

Comments

Projects
None yet
2 participants

Haven't found the possibility to add Pull Request so I add it here

I'd like to log some data during command running and save it the message field.

Owner

dfryta commented Mar 22, 2013

You can do that by returning this value in do() function:

https://github.com/Tivix/django-cron/blob/master/django_cron/__init__.py#L95

Owner

dfryta commented Mar 22, 2013

Example:

class MyCronJob(CronJobBase):
RUN_EVERY_MINS = 120 # every 2 hours

schedule = Schedule(run_every_mins=RUN_EVERY_MINS)
code = 'my_app.my_cron_job'    # a unique code

def do(self):
    ...    # do your thing here
    return "SOME MESSAGE"

@dfryta dfryta closed this May 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment