Add RAG semantic search and proactive event notifications
Implement hybrid knowledge search using Cloudflare Vectorize + Workers AI embeddings (bge-base-en-v1.5, 768d) merged with existing D1 LIKE queries, with graceful degradation when Vectorize is unavailable. Add admin API endpoints for batch/single article indexing. Add 4 proactive notification cron jobs: server status changes, deposit confirmation/rejection alerts, pending payment reminders (1h+), and bank deposit matching notifications — all with DB-column-based deduplication. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
12
src/index.ts
12
src/index.ts
@@ -124,6 +124,10 @@ export default {
|
||||
archiveOldConversations,
|
||||
cleanupStaleOrders,
|
||||
monitoringCheck,
|
||||
notifyServerStatusChanges,
|
||||
notifyTransactionStatusChanges,
|
||||
sendPaymentReminders,
|
||||
notifyBankMatches,
|
||||
} = await import('./services/cron-jobs');
|
||||
|
||||
try {
|
||||
@@ -135,14 +139,18 @@ export default {
|
||||
await cleanupExpiredSessions(env);
|
||||
break;
|
||||
|
||||
// Every 5 minutes: stale session/order cleanup
|
||||
// Every 5 minutes: stale cleanup + proactive notifications
|
||||
case '*/5 * * * *':
|
||||
await cleanupStaleOrders(env);
|
||||
await notifyServerStatusChanges(env);
|
||||
await notifyTransactionStatusChanges(env);
|
||||
await notifyBankMatches(env);
|
||||
break;
|
||||
|
||||
// Every hour: monitoring checks
|
||||
// Every hour: monitoring checks + payment reminders
|
||||
case '0 * * * *':
|
||||
await monitoringCheck(env);
|
||||
await sendPaymentReminders(env);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user