Dimitar Posted January 5, 2019 Report Share Posted January 5, 2019 Hello, Im creating a blesta module, the problem i have is that the module is using external API that have request rate limits. The problem i want to prevent is when running addService via the cron in case the API is rate limited and there is no response is it possible to skip the cron run, by skip i mean to skip this run and run it again on the next cron run? Quote Link to comment Share on other sites More sharing options...
Dimitar Posted January 5, 2019 Author Report Share Posted January 5, 2019 I did a bit more investigation on my own.. So what if i create error in the addService because there is this check `if (($errors = $this->Services->errors())) {`, will then the cron run again this service on the next run? Quote Link to comment Share on other sites More sharing options...
activa Posted January 6, 2019 Report Share Posted January 6, 2019 Only Yes If the service remain pending. Quote Link to comment Share on other sites More sharing options...
Tyson Posted January 9, 2019 Report Share Posted January 9, 2019 In that case, your module should set Input errors because it cannot provision the service remotely at that time. When your module's addService or editService is called, but you cannot add or edit the service, set errors and return: $this->Input->setErrors(['error' => 'Enter your error description here']); return; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.