Closed jsanta closed 1 year ago
That's strange. The bootstrap function (and therefore the Cron setup) should not run if the plugin is disabled.
For the Cron frequency, I can add setting an option for the ability to specify the expression to be used for the check.
In terms of the scarcity of try/catch I agree, error handling is a good idea :)
Both the cron frequency and try-catchs would be nice improvements! :)
This has been fixed in the latest release (v1.2.0)
In
config/plugins.js
file publisher is set to disable:Looking at the log the cron task is executing every minute, regardless of the publisher plugin being disabled. Web console is OK as the publisher buttons are not being showed, but the log shows that the crontask '/1 *' still executes itself. Cron task should at least verify the plugin is activated in order to avoid not useful executions.
Found out because I'm getting this error:
Tried hot patching the cron string to 0 0 /30 * but it still shows the error with the 1 minute cron string. Also related (but I've seen that this is a common mis-practice in most Strapi development) all propmises are treated in an optimistic way. All Promise based functions use async-await without considering that something can (and will) probably fail, so there's no error catching.
Strapi version: 4.4.3 Publisher plugin version: 1.1.3 (checked vs Github and cront-task.js file is the same I have on my installation).