Compare commits
No commits in common. "36c3507d8405e3f78acdecdb8b51b4cb8639e6ac" and "3837980e50f86707af86356661193a23b2fdb637" have entirely different histories.
36c3507d84
...
3837980e50
|
@ -45,10 +45,7 @@
|
||||||
<a v-if="!pollRefreshing" @click.stop="refresh">{{
|
<a v-if="!pollRefreshing" @click.stop="refresh">{{
|
||||||
i18n.ts.reload
|
i18n.ts.reload
|
||||||
}}</a>
|
}}</a>
|
||||||
<i
|
<span v-else>{{ i18n.ts._poll.refreshing }}</span>
|
||||||
v-else
|
|
||||||
class="ph-circle-notch ph-bold ph-lg fa-pulse ph-fw ph-lg"
|
|
||||||
></i>
|
|
||||||
</span>
|
</span>
|
||||||
<span v-if="isVoted"> · {{ i18n.ts._poll.voted }}</span>
|
<span v-if="isVoted"> · {{ i18n.ts._poll.voted }}</span>
|
||||||
<span v-else-if="closed"> · {{ i18n.ts._poll.closed }}</span>
|
<span v-else-if="closed"> · {{ i18n.ts._poll.closed }}</span>
|
||||||
|
|
|
@ -21,10 +21,8 @@ use std::sync::Arc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use tera::Tera;
|
use tera::Tera;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
use tokio::signal;
|
|
||||||
use tower_http::services::ServeFile;
|
use tower_http::services::ServeFile;
|
||||||
use tower_http::trace::TraceLayer;
|
use tower_http::trace::TraceLayer;
|
||||||
use tracing::error;
|
|
||||||
use tracing::log::info;
|
use tracing::log::info;
|
||||||
use tracing_subscriber::EnvFilter;
|
use tracing_subscriber::EnvFilter;
|
||||||
|
|
||||||
|
@ -119,33 +117,6 @@ async fn main() -> miette::Result<()> {
|
||||||
info!("Serving on: {addr}");
|
info!("Serving on: {addr}");
|
||||||
axum::Server::bind(&addr)
|
axum::Server::bind(&addr)
|
||||||
.serve(app.into_make_service())
|
.serve(app.into_make_service())
|
||||||
.with_graceful_shutdown(shutdown_signal())
|
|
||||||
.await
|
.await
|
||||||
.map_err(|e| miette!("Error running server: {}", e))
|
.map_err(|e| miette!("Error running server: {}", e))
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn shutdown_signal() {
|
|
||||||
let ctrl_c = async {
|
|
||||||
if let Err(e) = signal::ctrl_c().await {
|
|
||||||
error!("Ctrl+C signal handler error: {}", e);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#[cfg(unix)]
|
|
||||||
let terminate = async {
|
|
||||||
signal::unix::signal(signal::unix::SignalKind::terminate())
|
|
||||||
.expect("SIGTERM handler error")
|
|
||||||
.recv()
|
|
||||||
.await;
|
|
||||||
};
|
|
||||||
|
|
||||||
#[cfg(not(unix))]
|
|
||||||
let terminate = std::future::pending::<()>();
|
|
||||||
|
|
||||||
tokio::select! {
|
|
||||||
_ = ctrl_c => {},
|
|
||||||
_ = terminate => {},
|
|
||||||
}
|
|
||||||
|
|
||||||
info!("Shutting down...");
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue