1

I am using a hook_cron (mymodule_cron) in my custom module, but would like to know whether the cron run is successful or not and has sent the data using CURL, and from there, update a specific column value in my sql table. How to get this status?

Part of my codes:

$options=array(
    CURLOPT_URL            => $urlCron, 
    CURLOPT_RETURNTRANSFER => true, 
    CURLOPT_HEADER         => false
);

$CURL=curl_init();
curl_setopt_array($CURL,$options);
$content=curl_exec($CURL);
curl_close($CURL);
2

You can utilise watchdog at the end of your hook_cron implementation, then implement db_update to update your desired table.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.