Merge pull request #140 from laurentenhoor/feature/139-heartbeat-notifications
fix: send Telegram notifications for heartbeat pickups (#139)
This commit is contained in:
@@ -18,6 +18,7 @@ import { log as auditLog } from "../audit.js";
|
|||||||
import { checkWorkerHealth } from "./health.js";
|
import { checkWorkerHealth } from "./health.js";
|
||||||
import { projectTick } from "./tick.js";
|
import { projectTick } from "./tick.js";
|
||||||
import { createProvider } from "../providers/index.js";
|
import { createProvider } from "../providers/index.js";
|
||||||
|
import { notifyTickPickups, getNotificationConfig } from "../notify.js";
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Types
|
// Types
|
||||||
@@ -254,6 +255,16 @@ export async function tick(opts: {
|
|||||||
|
|
||||||
result.totalPickups += tickResult.pickups.length;
|
result.totalPickups += tickResult.pickups.length;
|
||||||
result.totalSkipped += tickResult.skipped.length;
|
result.totalSkipped += tickResult.skipped.length;
|
||||||
|
|
||||||
|
// Notify project group about any pickups
|
||||||
|
if (tickResult.pickups.length > 0) {
|
||||||
|
const notifyConfig = getNotificationConfig(pluginConfig);
|
||||||
|
await notifyTickPickups(tickResult.pickups, {
|
||||||
|
workspaceDir,
|
||||||
|
config: notifyConfig,
|
||||||
|
channel: project.channel,
|
||||||
|
});
|
||||||
|
}
|
||||||
if (isProjectActive || tickResult.pickups.length > 0) activeProjects++;
|
if (isProjectActive || tickResult.pickups.length > 0) activeProjects++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user