Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Pull Request: logging to message #18

Closed
russian-master opened this Issue · 2 comments

2 participants

@russian-master

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.

@dfryta
Owner

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

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

@dfryta
Owner

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.