Add an API that returns the most active users and the projects where they've been active

This commit is contained in:
Max Brunsfeld 2022-06-20 19:39:48 -07:00
parent bc3287e5d0
commit 44160869eb
7 changed files with 376 additions and 43 deletions

View file

@ -14,6 +14,7 @@ use serde::Deserialize;
use std::{
net::{SocketAddr, TcpListener},
sync::Arc,
time::Duration,
};
use tracing_log::LogTracer;
use tracing_subscriber::{filter::EnvFilter, fmt::format::JsonFields, Layer};
@ -66,6 +67,8 @@ async fn main() -> Result<()> {
.expect("failed to bind TCP listener");
let rpc_server = rpc::Server::new(state.clone(), None);
rpc_server.start_recording_project_activity(Duration::from_secs(5 * 60), rpc::RealExecutor);
let app = Router::<Body>::new()
.merge(api::routes(&rpc_server, state.clone()))
.merge(rpc::routes(rpc_server));