Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42e7761ea1 | ||
|
|
b20055293e |
3 changed files with 7 additions and 7 deletions
|
|
@ -56,8 +56,8 @@ impl Broker {
|
||||||
std::fs::create_dir_all(parent)
|
std::fs::create_dir_all(parent)
|
||||||
.with_context(|| format!("create db parent {}", parent.display()))?;
|
.with_context(|| format!("create db parent {}", parent.display()))?;
|
||||||
}
|
}
|
||||||
let conn = Connection::open(path)
|
let conn =
|
||||||
.with_context(|| format!("open broker db {}", path.display()))?;
|
Connection::open(path).with_context(|| format!("open broker db {}", path.display()))?;
|
||||||
conn.execute_batch(SCHEMA).context("apply broker schema")?;
|
conn.execute_batch(SCHEMA).context("apply broker schema")?;
|
||||||
let (events, _) = broadcast::channel(EVENT_CHANNEL);
|
let (events, _) = broadcast::channel(EVENT_CHANNEL);
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
|
|
|
||||||
|
|
@ -81,10 +81,7 @@ async fn messages_stream(
|
||||||
Sse::new(stream).keep_alive(KeepAlive::default())
|
Sse::new(stream).keep_alive(KeepAlive::default())
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn post_approve(
|
async fn post_approve(State(state): State<AppState>, AxumPath(id): AxumPath<i64>) -> Response {
|
||||||
State(state): State<AppState>,
|
|
||||||
AxumPath(id): AxumPath<i64>,
|
|
||||||
) -> Response {
|
|
||||||
match actions::approve(&state.coord, id).await {
|
match actions::approve(&state.coord, id).await {
|
||||||
Ok(()) => Redirect::to("/").into_response(),
|
Ok(()) => Redirect::to("/").into_response(),
|
||||||
Err(e) => error_response(&format!("approve {id} failed: {e:#}")),
|
Err(e) => error_response(&format!("approve {id} failed: {e:#}")),
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,10 @@ in
|
||||||
systemd.services.hive-c0re = {
|
systemd.services.hive-c0re = {
|
||||||
description = "hyperhive coordinator daemon";
|
description = "hyperhive coordinator daemon";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
path = [ "/run/current-system/sw" ];
|
path = [
|
||||||
|
pkgs.git
|
||||||
|
"/run/current-system/sw"
|
||||||
|
];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${cfg.package}/bin/hive-c0re --socket /run/hyperhive/host.sock serve --hyperhive-flake ${cfg.hyperhiveFlake} --dashboard-port ${toString cfg.dashboardPort}";
|
ExecStart = "${cfg.package}/bin/hive-c0re --socket /run/hyperhive/host.sock serve --hyperhive-flake ${cfg.hyperhiveFlake} --dashboard-port ${toString cfg.dashboardPort}";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue