mirror of
https://git.asonix.dog/asonix/background-jobs.git
synced 2024-11-21 19:40:59 +00:00
actix: don't misuse gauges
This commit is contained in:
parent
ecb9cae3c1
commit
e9c8651728
1 changed files with 2 additions and 2 deletions
|
@ -67,7 +67,7 @@ struct LocalWorkerStarter<State: Clone + 'static, Extras: 'static> {
|
||||||
|
|
||||||
impl<State: Clone + 'static, Extras: 'static> Drop for LocalWorkerStarter<State, Extras> {
|
impl<State: Clone + 'static, Extras: 'static> Drop for LocalWorkerStarter<State, Extras> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
metrics::gauge!("background-jobs.worker.running", -1.0, "queue" => self.queue.clone());
|
metrics::counter!("background-jobs.worker.finished", 1, "queue" => self.queue.clone());
|
||||||
|
|
||||||
let res = std::panic::catch_unwind(|| actix_rt::Arbiter::current().spawn(async move {}));
|
let res = std::panic::catch_unwind(|| actix_rt::Arbiter::current().spawn(async move {}));
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ pub(crate) async fn local_worker<State, Extras>(
|
||||||
State: Clone + 'static,
|
State: Clone + 'static,
|
||||||
Extras: 'static,
|
Extras: 'static,
|
||||||
{
|
{
|
||||||
metrics::gauge!("background-jobs.worker.running", 1.0, "queue" => queue.clone());
|
metrics::counter!("background-jobs.worker.started", 1, "queue" => queue.clone());
|
||||||
|
|
||||||
let starter = LocalWorkerStarter {
|
let starter = LocalWorkerStarter {
|
||||||
queue: queue.clone(),
|
queue: queue.clone(),
|
||||||
|
|
Loading…
Reference in a new issue