mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-27 17:22:39 +01:00
sleep timer code fixes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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()))?;
|
||||
|
||||
Reference in New Issue
Block a user