openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
26 lines (25 loc) • 864 B
JavaScript
import { n as isTruthyEnvValue } from "./env-HehwidXj.mjs";
import { t as startGmailWatcher } from "./gmail-watcher-mAYYhPh2.mjs";
//#region src/hooks/gmail-watcher-lifecycle.ts
/** Start the Gmail watcher with startup logs and env-based skip handling. */
async function startGmailWatcherWithLogs(e) {
if (isTruthyEnvValue(process.env.OPENCLAW_SKIP_GMAIL_WATCHER)) {
e.onSkipped?.();
return;
}
try {
const t = await startGmailWatcher(e.cfg, {
signal: e.signal,
scheduler: e.scheduler
});
if (t.started) {
e.log.info("gmail watcher started");
return;
}
if (t.reason && t.reason !== "hooks not enabled" && t.reason !== "no gmail account configured") e.log.warn(`gmail watcher not started: ${t.reason}`);
} catch (t) {
e.log.error(`gmail watcher failed to start: ${String(t)}`);
}
}
//#endregion
export { startGmailWatcherWithLogs };