I want schedule topic in the future with node-cron module. In details I want delay the topic creation at some timestamp. So in my plugin.jso I put this hook:
{
"hook": "filter:topic.create", "method": "editTopic"
}
and in my library.js
I do:
converter.editTopic = function(data, callback) {
var task = cron.schedule('* * * * *', function() {
return callback(null, data);
}, false);
task.start();
};
If I execute my code, the topic creation is schedule after a minute but in this minute the composer to write topics and posts is blocked. After that node-cron executes its task the composer become unblocked.
I don't know if I can schedule topic in the future with node-cron
, Anyone can help me to understand or I can do that?