benbyf Posted Monday at 02:08 PM Share Posted Monday at 02:08 PM I get messages turning up fine in my logs when used in my templates but not working (nothing happens) in my module for some reason. Here's what I have roughly: class customModule extends WireData implements Module, ConfigurableModule { public static function getModuleInfo() { return array( ... 'autoload' => true, 'requires' => "LazyCron", ); } private $cron_check = "everyMinute"; public function init() { // add hooks to CRON $this->addHook("LazyCron::every30Seconds", $this, 'checkFeedForNewPages'); } public function checkFeedForNewPages(HookEvent $e){ wire()->log->save('messages', 'working again'); } } Link to comment Share on other sites More sharing options...
wbmnfktr Posted 11 hours ago Share Posted 11 hours ago (edited) Do you have a LazyCron.cache file in /site/assets/cache? Maybe it's locked or corrupt or something that somehow prevents LazyCron to check and use that file and therefore doesn't work at all. Oh... and maybe try using that hook in /site/ready.php and go from there. Edited 11 hours ago by wbmnfktr added ready.php suggestion Link to comment Share on other sites More sharing options...
benbyf Posted 9 hours ago Author Share Posted 9 hours ago 1 hour ago, wbmnfktr said: Do you have a LazyCron.cache file in /site/assets/cache? Maybe it's locked or corrupt or something that somehow prevents LazyCron to check and use that file and therefore doesn't work at all. Oh... and maybe try using that hook in /site/ready.php and go from there. yep I have both LazyCron.casche and LazuCronLock.cache both there... should i delete them both to reset??? I ideally want it to work as a module as its needs to be duplicated to other sites and not as a singular modele - e.g. you can install several times to repeat for different needs... also I've made it work in teh past which is mostly whats annoying me that it no longer works as ive previously done it. Link to comment Share on other sites More sharing options...
wbmnfktr Posted 9 hours ago Share Posted 9 hours ago 23 minutes ago, benbyf said: should i delete them both to reset? Yes, please. The LazyCronLock.cache means there was an issue and LazyCron was stopped. You can safely delete both files in your DEV environment. Take a look at them. There are just timestamps in them, so LazyCron can check on those. Using ready.php was for testing purposes only. LazyCron will work from within a module. I use that a lot for maintenance tasks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now