Hi,

README.txt gives an example of an elysia_cron script that calls a function with arguments:

0 1 * * *  send_summary_mail('test@test.com', false);

However, when I do something similar, I get errors when the job runs informing me that arguments are missing from the function I'm calling (in the case of the example, the arguments 'test@test.com' and false will not be passed to "send_summary_mail").

Line 1281 of elysia_cron.module makes the call to the job function:

    if (function_exists($job)) {
      //sleep(5);
      $job();
    }

How do I pass arguments to the job function?
Thanks

Comments

gotheric’s picture

You're right, passing argument to functions don't work. It was a feature in an early realease of elysia cron, after the first big refactoring it was deleted by mistake.

I'll try to restore it in next official release.

NOTE: It seems that feature is not used very much by the community if the absence is reported only now :)

gotheric’s picture

Assigned: Unassigned » gotheric
Status: Active » Needs work
sinmao’s picture

Since passing arguments to functions doesn't work, what do you suggest if I want to clear the cache tables once a day? Should I write a function without arguments that calls cache_clear_all('*', $table, TRUE) and then use that function with elysia cron? Thanks!

gotheric’s picture

Yes.

You can put the function in your "config.php" if you don't have a module or other site specific library.

gotheric’s picture

Status: Needs work » Closed (fixed)

Works in next version of elysia cron