mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 20:43:41 +00:00
implements session counter (#463)
* implements session counter * implements session ids
This commit is contained in:
committed by
Aiden McClelland
parent
ac9b1a7744
commit
c6a0cf90bf
@@ -3,6 +3,7 @@ use std::collections::VecDeque;
|
||||
use std::net::{IpAddr, SocketAddr};
|
||||
use std::ops::Deref;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::atomic::{AtomicU64, AtomicUsize};
|
||||
use std::sync::Arc;
|
||||
|
||||
use bollard::Docker;
|
||||
@@ -97,6 +98,8 @@ pub struct RpcContextSeed {
|
||||
pub revision_cache: RwLock<VecDeque<Arc<Revision>>>,
|
||||
pub metrics_cache: RwLock<Option<crate::system::Metrics>>,
|
||||
pub shutdown: Sender<Option<Shutdown>>,
|
||||
pub websocket_count: AtomicUsize,
|
||||
pub session_id: AtomicU64,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
@@ -130,6 +133,8 @@ impl RpcContext {
|
||||
revision_cache: RwLock::new(VecDeque::new()),
|
||||
metrics_cache: RwLock::new(None),
|
||||
shutdown,
|
||||
websocket_count: AtomicUsize::new(0),
|
||||
session_id: AtomicU64::new(rand::random()),
|
||||
});
|
||||
let res = Self(seed);
|
||||
res.managers
|
||||
|
||||
Reference in New Issue
Block a user