sleep timer code fixes

This commit is contained in:
euzu
2025-06-11 16:57:37 +02:00
parent 49c7f64a8f
commit 69f9fc5e45
2 changed files with 8 additions and 1 deletions
@@ -44,7 +44,7 @@ where
}
fn convert_stream(stream: BoxStream<Bytes>) -> BoxStream<Result<Bytes, StreamError>> {
Box::pin(ReceiverStreamWrapper { stream }.boxed())
ReceiverStreamWrapper { stream }.boxed()
}
type SubscriberId = usize;
+7
View File
@@ -645,6 +645,13 @@ impl Config {
if let Some(mapping_path) = &self.mapping_path {
self.t_mapping_file_path = mapping_path.to_string();
}
if let Some(mins) = self.sleep_timer_mins {
if mins == 0 {
return Err(TuliproxError::new(TuliproxErrorKind::Info, "`sleep_timer_mins` must be > 0 when specified".to_string()));
}
}
if include_computed {
self.t_access_token_secret = generate_secret();
self.t_encrypt_secret = <&[u8] as TryInto<[u8; 16]>>::try_into(&generate_secret()[0..16]).map_err(|err| TuliproxError::new(TuliproxErrorKind::Info, err.to_string()))?;