diff --git a/src/bot_worker.rs b/src/bot_worker.rs index 29c78ad..3e2d12d 100644 --- a/src/bot_worker.rs +++ b/src/bot_worker.rs @@ -17,13 +17,17 @@ pub struct Worker{ file:BotDebug, } +fn date()->String{ + format!("{}",std::time::SystemTime::UNIX_EPOCH.elapsed().unwrap().as_nanos()) +} + pub fn new<'a>(scope:&'a std::thread::Scope<'a,'_>)->crate::worker::QNWorker<'a,Instruction>{ let mut worker=Worker{ - file:BotDebug::new().unwrap(), + file:BotDebug::new(date()).unwrap(), }; crate::worker::QNWorker::new(scope,move|instruction|{ match instruction{ - Instruction::Create=>worker.file=BotDebug::new().unwrap(), + Instruction::Create=>worker.file=BotDebug::new(date()).unwrap(), //Instruction::Delete=>worker.file.delete().unwrap(), Instruction::Push{ins}=>worker.file.push(ins).unwrap(), }