Compare commits
1 commit
58b047cdb5
...
346920cde5
Author | SHA1 | Date | |
---|---|---|---|
346920cde5 |
5 changed files with 12 additions and 22 deletions
|
@ -7,7 +7,6 @@ repository = { workspace = true }
|
|||
description = "webhook actor for git-next, the trunk-based development manager"
|
||||
|
||||
[dependencies]
|
||||
git-next-actor-macros = { workspace = true }
|
||||
git-next-config = { workspace = true }
|
||||
git-next-repo-actor = { workspace = true }
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
mod shutdown_webhook;
|
|
@ -1,13 +0,0 @@
|
|||
//
|
||||
use actix::prelude::*;
|
||||
|
||||
use crate::{ShutdownWebhook, WebhookActor};
|
||||
|
||||
impl Handler<ShutdownWebhook> for WebhookActor {
|
||||
type Result = ();
|
||||
|
||||
fn handle(&mut self, _msg: ShutdownWebhook, ctx: &mut Self::Context) -> Self::Result {
|
||||
self.spawn_handle.take();
|
||||
ctx.stop();
|
||||
}
|
||||
}
|
|
@ -1,13 +1,10 @@
|
|||
//
|
||||
use actix::prelude::*;
|
||||
|
||||
mod handlers;
|
||||
pub mod messages;
|
||||
mod router;
|
||||
mod server;
|
||||
|
||||
use git_next_repo_actor::messages::WebhookNotification;
|
||||
pub use messages::ShutdownWebhook;
|
||||
|
||||
use std::net::SocketAddr;
|
||||
|
||||
|
@ -43,3 +40,15 @@ impl Actor for WebhookActor {
|
|||
self.spawn_handle.replace(spawn_handle);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Message)]
|
||||
#[rtype(result = "()")]
|
||||
pub struct ShutdownWebhook;
|
||||
impl Handler<ShutdownWebhook> for WebhookActor {
|
||||
type Result = ();
|
||||
|
||||
fn handle(&mut self, _msg: ShutdownWebhook, ctx: &mut Self::Context) -> Self::Result {
|
||||
self.spawn_handle.take();
|
||||
ctx.stop();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
//
|
||||
use git_next_actor_macros::message;
|
||||
|
||||
message!(ShutdownWebhook: "Request to shutdown the Webhook actor");
|
Loading…
Reference in a new issue