36 lines
954 B
TypeScript
36 lines
954 B
TypeScript
import * as plugins from '../plugins.js';
|
|
import { Cloudly } from '../classes.cloudly.js';
|
|
|
|
import { logger } from '../logger.js';
|
|
|
|
export class CloudlyTaskmanager {
|
|
public cloudlyRef: Cloudly;
|
|
|
|
constructor(cloudlyRefArg: Cloudly) {
|
|
this.cloudlyRef = cloudlyRefArg;
|
|
}
|
|
|
|
public everyMinuteTask = new plugins.taskbuffer.Task({
|
|
taskFunction: async () => {},
|
|
});
|
|
|
|
public everyHourTask = new plugins.taskbuffer.Task({
|
|
taskFunction: async () => {
|
|
logger.log('info', `Performing hourly maintenance check.`);
|
|
const configs = await this.cloudlyRef.clusterManager.getAllClusters();
|
|
logger.log('info', `Got ${configs.length} configs`);
|
|
configs.map((configArg) => {
|
|
console.log(configArg.name);
|
|
});
|
|
},
|
|
});
|
|
|
|
public everyDayTask = new plugins.taskbuffer.Task({
|
|
taskFunction: async () => {},
|
|
});
|
|
|
|
public everyWeekTask = new plugins.taskbuffer.Task({
|
|
taskFunction: async () => {},
|
|
});
|
|
}
|