feat: add common queue
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
use std::{net::SocketAddr, pin::Pin};
|
||||
use std::{collections::BTreeMap, net::SocketAddr, pin::Pin};
|
||||
|
||||
use anyhow::Context;
|
||||
use futures::Stream;
|
||||
use notmad::{Component, MadError};
|
||||
use tonic::transport::Server;
|
||||
|
||||
use crate::grpc::*;
|
||||
use crate::{agent::models::Commands, grpc::*};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct GrpcServer {
|
||||
@@ -70,9 +70,18 @@ impl crate::grpc::churn_server::Churn for GrpcServer {
|
||||
loop {
|
||||
interval.tick().await;
|
||||
|
||||
let Ok(schedule_task) = serde_json::to_string(&Commands::ScheduleTask {
|
||||
task: "refresh".into(),
|
||||
properties: BTreeMap::default(),
|
||||
}) else {
|
||||
tracing::warn!("failed to serialize event");
|
||||
continue;
|
||||
};
|
||||
|
||||
if let Err(e) = tx
|
||||
.send(Ok(ListenEventsResponse {
|
||||
value: uuid::Uuid::new_v4().to_string(),
|
||||
id: uuid::Uuid::new_v4().to_string(),
|
||||
value: schedule_task,
|
||||
}))
|
||||
.await
|
||||
{
|
||||
|
Reference in New Issue
Block a user