Hi,
Can someone explain what running the drupal cron job does and at what intervals??
Here is the situation.. We are updating a particular field directly in the database from another source.. This is working fine but the issue is that the updated information doesn't show on the site straight away..
I have cron running every hour and have the cache lifetimes on the performance page set to 10 min but even after waiting an hour and a cron run the page still isn't always updated with the new value of the field.. Sometimes it is and sometimes it isn't..
The only way I have found to "force" an update is to clear all the caches but this seems like a massive overkill..
If I can find out when it will update on its own I can set the user expectations so they know they have to wait that long for the data to be updated..
Thanks for any information..
On Tue, Oct 2, 2012 at 7:11 AM, Wipe_Out wrote:
Hi,
Can someone explain what running the drupal cron job does and at what intervals??
Here is the situation.. We are updating a particular field directly in the database from another source.. This is working fine but the issue is that the updated information doesn't show on the site straight away..
I have cron running every hour and have the cache lifetimes on the performance page set to 10 min but even after waiting an hour and a cron run the page still isn't always updated with the new value of the field.. Sometimes it is and sometimes it isn't..
Each module may have a cron hook implementation. The cron.php process gets 240 seconds to execute those cron hook implementations. If the 240 seconds time limit is exceeded then it is possible that some cron hook implementations do not execute or complete. I tend to use a 5 minute cycle and use Elysia Cron module to adjust which cron hook implementations run at various times.
The only way I have found to "force" an update is to clear all the caches but this seems like a massive overkill..
May strictly be a timing issue. I don't know but usually these effects for me tend to be related to my impatience or a lack of understanding in the flow.
If I can find out when it will update on its own I can set the user expectations so they know they have to wait that long for the data to be updated..
As explained above, you may be exceeding the 240 second cycle before the cron hook implementation executes. The experience will be variable even with my suggestion of every 5 minutes and Elysia cron.
Thanks for any information..
HTH.
On 2 October 2012 13:22, Earnie Boyd earnie@users.sourceforge.net wrote:
On Tue, Oct 2, 2012 at 7:11 AM, Wipe_Out wrote:
Hi,
Can someone explain what running the drupal cron job does and at what intervals??
Here is the situation.. We are updating a particular field directly in
the
database from another source.. This is working fine but the issue is that the updated information doesn't show on the site straight away..
I have cron running every hour and have the cache lifetimes on the performance page set to 10 min but even after waiting an hour and a cron
run
the page still isn't always updated with the new value of the field.. Sometimes it is and sometimes it isn't..
Each module may have a cron hook implementation. The cron.php process gets 240 seconds to execute those cron hook implementations. If the 240 seconds time limit is exceeded then it is possible that some cron hook implementations do not execute or complete. I tend to use a 5 minute cycle and use Elysia Cron module to adjust which cron hook implementations run at various times.
The only way I have found to "force" an update is to clear all the caches but this seems like a massive overkill..
May strictly be a timing issue. I don't know but usually these effects for me tend to be related to my impatience or a lack of understanding in the flow.
If I can find out when it will update on its own I can set the user expectations so they know they have to wait that long for the data to be updated..
As explained above, you may be exceeding the 240 second cycle before the cron hook implementation executes. The experience will be variable even with my suggestion of every 5 minutes and Elysia cron.
Thanks for any information..
HTH.
-- Earnie
-- https://sites.google.com/site/earnieboyd
[ Drupal support list | http://lists.drupal.org/ ]
Thanks Earnie.. That's useful..
How are you updating the field? __________________ Michael Prasuhn http://mikeyp.net
On Oct 2, 2012, at 4:11 AM, Wipe_Out wipe_out@users.sourceforge.net wrote:
Hi,
Can someone explain what running the drupal cron job does and at what intervals??
Here is the situation.. We are updating a particular field directly in the database from another source.. This is working fine but the issue is that the updated information doesn't show on the site straight away..
I have cron running every hour and have the cache lifetimes on the performance page set to 10 min but even after waiting an hour and a cron run the page still isn't always updated with the new value of the field.. Sometimes it is and sometimes it isn't..
The only way I have found to "force" an update is to clear all the caches but this seems like a massive overkill..
If I can find out when it will update on its own I can set the user expectations so they know they have to wait that long for the data to be updated..
Thanks for any information..
[ Drupal support list | http://lists.drupal.org/ ]
On 2 October 2012 17:59, Michael Prasuhn mike@mikeyp.net wrote:
How are you updating the field? __________________ Michael Prasuhn http://mikeyp.net
Directly in the database..
I know its bad and it means none of the Drupal hooks run but its the only way we could do this one particular update easily and in testing other than it not displaying immediately it doesn't seem to have any adverse effects..
On Tue, Oct 2, 2012 at 2:23 PM, Wipe_Out wipe_out@users.sourceforge.net wrote:
On 2 October 2012 17:59, Michael Prasuhn mike@mikeyp.net wrote:
How are you updating the field? __________________ Michael Prasuhn http://mikeyp.net
Directly in the database..
I know its bad and it means none of the Drupal hooks run but its the only way we could do this one particular update easily and in testing other than it not displaying immediately it doesn't seem to have any adverse effects..
By directly do you mean using SQL or node_load/node_save? You should never use SQL to directly update the node. You may programmatically update it using node_load, modify object parameter then follow with node_save. This allows all the other node hooks to operate properly.
On 2 October 2012 19:57, Earnie Boyd earnie@users.sourceforge.net wrote:
On Tue, Oct 2, 2012 at 2:23 PM, Wipe_Out wipe_out@users.sourceforge.net wrote:
On 2 October 2012 17:59, Michael Prasuhn mike@mikeyp.net wrote:
How are you updating the field? __________________ Michael Prasuhn http://mikeyp.net
Directly in the database..
I know its bad and it means none of the Drupal hooks run but its the only way we could do this one particular update easily and in testing other
than
it not displaying immediately it doesn't seem to have any adverse
effects..
By directly do you mean using SQL or node_load/node_save? You should never use SQL to directly update the node. You may programmatically update it using node_load, modify object parameter then follow with node_save. This allows all the other node hooks to operate properly.
-- Earnie
-- https://sites.google.com/site/earnieboyd
[ Drupal support list | http://lists.drupal.org/ ]
Yes I know but in this case we didn't have a choice so had to try it.. Its just updating a datetime field with a new value.. The testing we did didn't reveal any issues other than the fact that the cache needs to be cleared for the new values to show in Drupal..
Originally we tried updating with a CSV through the feeds module but there is a timezone bug in feeds that stops this working..
On Tue, Oct 2, 2012 at 4:30 PM, Wipe_Out wrote:
On 2 October 2012 19:57, Earnie Boyd earnie@users.sourceforge.net wrote:
On Tue, Oct 2, 2012 at 2:23 PM, Wipe_Out wipe_out@users.sourceforge.net wrote:
On 2 October 2012 17:59, Michael Prasuhn mike@mikeyp.net wrote:
How are you updating the field? __________________ Michael Prasuhn http://mikeyp.net
Directly in the database..
I know its bad and it means none of the Drupal hooks run but its the only way we could do this one particular update easily and in testing other than it not displaying immediately it doesn't seem to have any adverse effects..
By directly do you mean using SQL or node_load/node_save? You should never use SQL to directly update the node. You may programmatically update it using node_load, modify object parameter then follow with node_save. This allows all the other node hooks to operate properly.
Yes I know but in this case we didn't have a choice so had to try it.. Its just updating a datetime field with a new value.. The testing we did didn't reveal any issues other than the fact that the cache needs to be cleared for the new values to show in Drupal..
Originally we tried updating with a CSV through the feeds module but there is a timezone bug in feeds that stops this working..
The node_save() would DTRT with the cache record.
On Wed, Oct 3, 2012 at 2:39 PM, Earnie Boyd earnie@users.sourceforge.netwrote:
On Tue, Oct 2, 2012 at 4:30 PM, Wipe_Out wrote:
On 2 October 2012 19:57, Earnie Boyd earnie@users.sourceforge.net
wrote:
On Tue, Oct 2, 2012 at 2:23 PM, Wipe_Out <
wipe_out@users.sourceforge.net>
wrote:
On 2 October 2012 17:59, Michael Prasuhn mike@mikeyp.net wrote:
How are you updating the field? __________________ Michael Prasuhn http://mikeyp.net
Directly in the database..
I know its bad and it means none of the Drupal hooks run but its the only way we could do this one particular update easily and in testing other than it not displaying immediately it doesn't seem to have any adverse effects..
By directly do you mean using SQL or node_load/node_save? You should never use SQL to directly update the node. You may programmatically update it using node_load, modify object parameter then follow with node_save. This allows all the other node hooks to operate properly.
Yes I know but in this case we didn't have a choice so had to try it..
Its
just updating a datetime field with a new value.. The testing we did
didn't
reveal any issues other than the fact that the cache needs to be cleared
for
the new values to show in Drupal..
Originally we tried updating with a CSV through the feeds module but
there
is a timezone bug in feeds that stops this working..
The node_save() would DTRT with the cache record.
-- Earnie
-- https://sites.google.com/site/earnieboyd
[ Drupal support list | http://lists.drupal.org/ ]
If you can do a bootstrap and assuming you know the nid, you can use
entity_get_controller http://api.drupal.org/api/drupal/includes%21common.inc/function/entity_get_controller/7('node')->resetCache http://api.drupal.org/api/search/7/resetCache(array($node->nid http://api.drupal.org/api/search/7/nid));
or
cache_clear_all http://api.drupal.org/api/search/6/cache_clear_all();
if you're using Drupal 6.
On Wed, Oct 3, 2012 at 9:59 AM, Christian Lopez clopez@emergya.com wrote:
On Wed, Oct 3, 2012 at 2:39 PM, Earnie Boyd earnie@users.sourceforge.net wrote:
On Tue, Oct 2, 2012 at 4:30 PM, Wipe_Out wrote:
On 2 October 2012 19:57, Earnie Boyd earnie@users.sourceforge.net wrote:
On Tue, Oct 2, 2012 at 2:23 PM, Wipe_Out wipe_out@users.sourceforge.net wrote:
On 2 October 2012 17:59, Michael Prasuhn mike@mikeyp.net wrote:
How are you updating the field? __________________ Michael Prasuhn http://mikeyp.net
Directly in the database..
I know its bad and it means none of the Drupal hooks run but its the only way we could do this one particular update easily and in testing other than it not displaying immediately it doesn't seem to have any adverse effects..
By directly do you mean using SQL or node_load/node_save? You should never use SQL to directly update the node. You may programmatically update it using node_load, modify object parameter then follow with node_save. This allows all the other node hooks to operate properly.
Yes I know but in this case we didn't have a choice so had to try it.. Its just updating a datetime field with a new value.. The testing we did didn't reveal any issues other than the fact that the cache needs to be cleared for the new values to show in Drupal..
Originally we tried updating with a CSV through the feeds module but there is a timezone bug in feeds that stops this working..
The node_save() would DTRT with the cache record.
-- Earnie
-- https://sites.google.com/site/earnieboyd
[ Drupal support list | http://lists.drupal.org/ ]
If you can do a bootstrap and assuming you know the nid, you can use
entity_get_controller('node')->resetCache(array($node->nid));or
cache_clear_all();
if you're using Drupal 6.
This still circumvents the hook_node* implementations. You shouldn't do this, node_save() will DTRT for you.
http://api.drupal.org/api/drupal/modules%21node%21node.module/function/node_...