chore: increase GmailWatcher default poll interval from 60s to 300s

This commit is contained in:
William Valentin
2026-02-11 08:43:48 -08:00
parent 60b214e7c4
commit eea7ca62a8
5 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -109,7 +109,7 @@ function createMockConfig(overrides = {}) {
credentials_file: '~/.config/flynn/gmail-credentials.json', credentials_file: '~/.config/flynn/gmail-credentials.json',
token_file: '~/.config/flynn/gmail-token.json', token_file: '~/.config/flynn/gmail-token.json',
watch_labels: ['INBOX'], watch_labels: ['INBOX'],
poll_interval: '60s', poll_interval: '300s',
output: { output: {
channel: 'telegram', channel: 'telegram',
peer: '12345', peer: '12345',
+2 -2
View File
@@ -90,7 +90,7 @@ export class GmailWatcher implements ChannelAdapter {
} }
// Start polling fallback // Start polling fallback
const pollMs = parseInterval(this.config.poll_interval ?? '60s'); const pollMs = parseInterval(this.config.poll_interval ?? '300s');
this.pollTimer = setInterval(() => { this.pollTimer = setInterval(() => {
this.pollForNewMessages().catch((err) => { this.pollForNewMessages().catch((err) => {
console.error('GmailWatcher: Poll error —', err instanceof Error ? err.message : err); console.error('GmailWatcher: Poll error —', err instanceof Error ? err.message : err);
@@ -98,7 +98,7 @@ export class GmailWatcher implements ChannelAdapter {
}, pollMs); }, pollMs);
this._status = 'connected'; this._status = 'connected';
console.log(`GmailWatcher: Connected (poll_interval=${this.config.poll_interval ?? '60s'})`); console.log(`GmailWatcher: Connected (poll_interval=${this.config.poll_interval ?? '300s'})`);
} }
async disconnect(): Promise<void> { async disconnect(): Promise<void> {
+1 -1
View File
@@ -152,7 +152,7 @@ const gmailSchema = z.object({
credentials_file: z.string().optional(), credentials_file: z.string().optional(),
token_file: z.string().default('~/.config/flynn/gmail-token.json'), token_file: z.string().default('~/.config/flynn/gmail-token.json'),
watch_labels: z.array(z.string()).default(['INBOX']), watch_labels: z.array(z.string()).default(['INBOX']),
poll_interval: z.string().default('60s'), poll_interval: z.string().default('300s'),
history_start: z.string().optional(), // ISO date string — only process emails after this date history_start: z.string().optional(), // ISO date string — only process emails after this date
output: z.object({ output: z.object({
channel: z.string().min(1), channel: z.string().min(1),
+1 -1
View File
@@ -584,7 +584,7 @@ describe('redactConfig comprehensive credential redaction', () => {
{ name: 'gitlab', secret: 'wh-secret-2', message: '{{body}}', output: { channel: 'telegram', peer: '456' }, enabled: true }, { name: 'gitlab', secret: 'wh-secret-2', message: '{{body}}', output: { channel: 'telegram', peer: '456' }, enabled: true },
{ name: 'no-secret', message: '{{body}}', output: { channel: 'telegram', peer: '789' }, enabled: true }, { name: 'no-secret', message: '{{body}}', output: { channel: 'telegram', peer: '789' }, enabled: true },
], ],
gmail: { enabled: true, credentials_file: '/path/to/creds.json', token_file: '/path/to/token.json', watch_labels: ['INBOX'], poll_interval: '60s', output: { channel: 'telegram', peer: '123' }, message: 'new email' }, gmail: { enabled: true, credentials_file: '/path/to/creds.json', token_file: '/path/to/token.json', watch_labels: ['INBOX'], poll_interval: '300s', output: { channel: 'telegram', peer: '123' }, message: 'new email' },
heartbeat: { enabled: false, interval: '5m', checks: ['gateway'], failure_threshold: 2, disk_threshold_mb: 100 }, heartbeat: { enabled: false, interval: '5m', checks: ['gateway'], failure_threshold: 2, disk_threshold_mb: 100 },
}, },
mcp: { mcp: {
+1 -1
View File
@@ -45,7 +45,7 @@ const testConfig: NonNullable<GmailConfig> = {
credentials_file: '/tmp/test-creds.json', credentials_file: '/tmp/test-creds.json',
token_file: '/tmp/test-token.json', token_file: '/tmp/test-token.json',
watch_labels: ['INBOX'], watch_labels: ['INBOX'],
poll_interval: '60s', poll_interval: '300s',
output: { channel: 'discord', peer: '123' }, output: { channel: 'discord', peer: '123' },
message: '{{from}}: {{subject}}', message: '{{from}}: {{subject}}',
}; };