Worker: separate containers for e-mail and AI generation
WORKER_TASKS (email, cleanup, analyses; all by default) picks the jobs of a worker process. In production the worker sends e-mails and cleans up (and will take the other background jobs), worker-ai writes the analyses and answers with its quick and slow lanes, sized from the server's .env. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -223,6 +223,16 @@ async fn cleanup_removes_only_expired_data(db: PgPool) {
|
||||
|
||||
// --- analyses ----------------------------------------------------------------------------
|
||||
|
||||
#[test]
|
||||
fn worker_tasks_are_chosen_by_name() {
|
||||
use crate::config::Tasks;
|
||||
let mail = Tasks::parse("email, cleanup").unwrap();
|
||||
assert_eq!(mail, Tasks { email: true, cleanup: true, analyses: false });
|
||||
assert_eq!(Tasks::parse("analyses").unwrap(), Tasks { email: false, cleanup: false, analyses: true });
|
||||
assert!(Tasks::parse("emails").is_err());
|
||||
assert!(Tasks::parse(" , ").is_err());
|
||||
}
|
||||
|
||||
mod analyses {
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user