Closed hahmadia closed 3 years ago
Not sure why the cron job is not posting the message every minute like I expect it too :( Only does the first time but never after that.
Nice work! From your post:
There was only one cron job running every minute. I tried migrating it to use the above cluster API. Problem is that it works on startup but never works after that.
So when I connect my calendar, it will post the message
Test Job123123
but then every minute after it doesn't post the message anymore.
I'm not sure about why the job is only running once. Do you have any ideas about what code is not running in the imported mattermost-plugin-api
code?
Instead of running a separate job for each user, I suggest running just one job that will service all users. This will require the plugin to save info about each user in one array in the kv store. Then in the one job, iterate over that array and process each user separately.
Check out the job implementation here https://github.com/mattermost/mattermost-plugin-mscalendar/blob/e05112bcad3ad6129b9fe2886a4f3a8056120ea2/server/mscalendar/availability.go#L41
@mickmister Done! I implemented a simpler version. As for the jobs not running properly, I think it was something locally. After a restart and nuke, the jobs are running as expected.
Summary
Make HA Compatible