[development] D6 Determining if cron or user

jeff at ayendesigns.com jeff at ayendesigns.com
Fri Sep 16 16:24:49 UTC 2011


Great! Thanks Carl.
Ayen Designs - quality software the first time, every time!

-----Original Message-----
From: Carl Wiedemann <carl.wiedemann at gmail.com>
Sender: development-bounces at drupal.org
Date: Fri, 16 Sep 2011 10:26:36 
To: <development at drupal.org>
Reply-To: development at drupal.org
Subject: Re: [development] D6 Determining if cron or user

Sorry, you said Drupal 6 -- use variable_get('cron_semaphore'). See
http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_cron_run/6

The lock API is D7.

Carl Wiedemann
Website design and development consulting
carl.wiedemann at gmail.com | skype: c4rlww



On Fri, Sep 16, 2011 at 10:25 AM, Carl Wiedemann
<carl.wiedemann at gmail.com>wrote:

> You could check global $user -- cron runs as anon. You could also
> check lock_acquire('cron', 240.0), which indicates cron is running.
>
> Carl Wiedemann
> Website design and development consulting
> carl.wiedemann at gmail.com | skype: c4rlww
>
>
>
> On Fri, Sep 16, 2011 at 10:06 AM, <jeff at ayendesigns.com> wrote:
>
>>     I've been chasing the most annoying issue. I have a module that fires
>> off XML when a video node is updated, in order to prepare the advertising
>> that plays prior the video. The issue was that this process seemed to he
>> inconsistent, and it turns out that a cron job that updates the Facebook
>> 'likes' data is doing node saves, which triggers nodeapi with op=update just
>> like saving a node via the node form.
>>
>> I thought of adding a hidden field to the node form and testing for it,
>> but I was wondering if there is an easier way to determine what is firing
>> the hook, batch or user, process, something?
>>
>> Jeff
>>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110916/e8421b22/attachment.html 


More information about the development mailing list