mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 04:49:41 -05:00
18 lines
441 B
JavaScript
18 lines
441 B
JavaScript
import { CronJobStatus } from '../cronJobStorage';
|
|
import Users from '/models/users';
|
|
|
|
// Publish migration status for admin users only
|
|
Meteor.publish('cronMigrationStatus', async function() {
|
|
if (!this.userId) {
|
|
return this.ready();
|
|
}
|
|
|
|
const user = await Users.findOneAsync(this.userId);
|
|
if (!user || !user.isAdmin) {
|
|
return this.ready();
|
|
}
|
|
|
|
// Publish all cron job status documents
|
|
return CronJobStatus.find({});
|
|
});
|