mirror of
https://github.com/wekan/wekan.git
synced 2026-02-09 17:54:21 +01:00
23 lines
561 B
JavaScript
23 lines
561 B
JavaScript
|
|
import { CronJobStatus } from '/server/cronJobStorage';
|
||
|
|
|
||
|
|
// Publish detailed migration progress data for admin users
|
||
|
|
Meteor.publish('migrationProgress', function() {
|
||
|
|
if (!this.userId) {
|
||
|
|
return this.ready();
|
||
|
|
}
|
||
|
|
|
||
|
|
const user = Users.findOne(this.userId);
|
||
|
|
if (!user || !user.isAdmin) {
|
||
|
|
return this.ready();
|
||
|
|
}
|
||
|
|
|
||
|
|
// Publish detailed migration progress documents
|
||
|
|
// This includes current running job details, estimated time, etc.
|
||
|
|
return CronJobStatus.find({
|
||
|
|
$or: [
|
||
|
|
{ jobType: 'migration' },
|
||
|
|
{ jobId: 'migration' }
|
||
|
|
]
|
||
|
|
});
|
||
|
|
});
|