Ryan-


On Tue, Mar 13, 2012 at 3:20 PM, Roberto De Ioris <[email protected]> wrote:
>
>> On Tue, Mar 13, 2012 at 2:38 PM, Roberto De Ioris <[email protected]>
>> wrote:
>>>
>>>> Hey everyone,
>>>>
>>>> I'm having some issues with uWSGI 1.0.6 executing the cron a little
>>>> more than I expect it to.  For example, I have a method decorated by
>>>> @cron(0, 16, -1, -1, -1).  Typically, I would expect this to execute
>>>> the method once at 16:00, but instead, it will execute it 2 or 3
>>>> times.  Here's what it looks like around that time in my logs:
>>>>
>>>> [uwsgi-signal] you have registered this signal in worker 9 memory
>>>> area, only that process will be able to run it
>>>>
>
> Do you get this message during cron management or during a request ?

uWSGI automatically executes it at 16:00 during what I assume is cron
management.  I don't make any sort of request to initiate the cron.

>
> Is is triggered only when a signal is registered in a worker (and not in
> the master) For some reason your signal are re-registered (and each signal
> is a cron event).
>
> Can you paste the part of your code registering the signal ? (the @cron
> decorated)

Sure, here you go:

@cron(0, 16, -1, -1, -1)
def admin_daily_report_cron(num):
    from businesses.models import Business, BusinessLocationDailySummary

    yesterday = datetime.now() - timedelta(days=1)

    recent_txn_biz_pks = BusinessLocationDailySummary.objects.filter(
            summary_day=yesterday.date()).values_list('biz_id', flat=True)
    recent_txn_biz_pks = set(recent_txn_biz_pks)

    eligible_biz_pks = Business.objects.filter(
            pk__in=recent_txn_biz_pks,
            biz_status='ACTIVE').values_list('pk', flat=True)

    for biz_id in eligible_biz_pks:
        admin_daily_report_async.spool(biz_id=str(biz_id))

>
> --
> Roberto De Ioris
> http://unbit.it
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to