So how the hell this is 10x faster ;-)

Will check genereted SQL tommorow.

Wysłane z iPhone'a

Dnia 26 lut 2013 o godz. 19:36 Sumit Chachra <notifications@github.com> napisał(a):

> In django_cron/__init__.py:
> 
> >                  if not last_job.is_success and cron_job.schedule.retry_after_failure_mins:
> >                      if timezone.now() > last_job.start_time + timedelta(minutes=cron_job.schedule.retry_after_failure_mins):
> >                          return True
> >                      else:
> >                          return False
> >  
> > -            qset = CronJobLog.objects.filter(code=cron_job.code, is_success=True, ran_at_time__isnull=True).order_by('-start_time')
> > -            if qset:
> > -                previously_ran_successful_cron = qset[0]
> Err... no :-) Getting all results would be BAD! See https://docs.djangoproject.com/en/dev/topics/db/queries/#limiting-querysets *Slicing.* As explained in *Limiting QuerySets*<https://docs.djangoproject.com/en/dev/topics/db/queries/#limiting-querysets>, a QuerySet can be sliced, using Python’s array-slicing syntax. Slicing an unevaluated QuerySet usually returns another unevaluated QuerySet On Tue, Feb 26, 2013 at 10:31 AM, Dariusz Fryta <notifications@github.com>wrote:
> …
> —
> Reply to this email directly or view it on GitHub.