forked from mirrors/relay
Update to git background jobs
This commit is contained in:
parent
f5d7c80d2e
commit
79fa0fb828
3 changed files with 20 additions and 29 deletions
39
Cargo.lock
generated
39
Cargo.lock
generated
|
@ -56,9 +56,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "actix-http"
|
name = "actix-http"
|
||||||
version = "3.2.0"
|
version = "3.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cfeeac0149fc76f58894a08f221282975f4c6659d2cb31ffd22a3be7a83c5771"
|
checksum = "6f9ffb6db08c1c3a1f4aef540f1a63193adc73c4fbd40b75a95fc8c5258f6e51"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-codec",
|
"actix-codec",
|
||||||
"actix-rt",
|
"actix-rt",
|
||||||
|
@ -330,7 +330,7 @@ dependencies = [
|
||||||
"tracing-log",
|
"tracing-log",
|
||||||
"tracing-opentelemetry",
|
"tracing-opentelemetry",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
"uuid 1.1.2",
|
"uuid",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -480,9 +480,8 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "background-jobs"
|
name = "background-jobs"
|
||||||
version = "0.12.0"
|
version = "0.13.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://git.asonix.dog/asonix/background-jobs#250d2f0a33369a657563f58b5e8218338a267ec4"
|
||||||
checksum = "5c301b3ccb60fa2aadb4da111e27b257ddc4f0509848c43c85764dc14f7a49a3"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"background-jobs-actix",
|
"background-jobs-actix",
|
||||||
"background-jobs-core",
|
"background-jobs-core",
|
||||||
|
@ -490,9 +489,8 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "background-jobs-actix"
|
name = "background-jobs-actix"
|
||||||
version = "0.12.0"
|
version = "0.13.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://git.asonix.dog/asonix/background-jobs#250d2f0a33369a657563f58b5e8218338a267ec4"
|
||||||
checksum = "65a0dcbc94e0644fcfbaddc19705fae2d6947426682aeab7582d772f4d80b8df"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-rt",
|
"actix-rt",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
@ -506,26 +504,25 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-futures",
|
"tracing-futures",
|
||||||
"uuid 0.8.2",
|
"uuid",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "background-jobs-core"
|
name = "background-jobs-core"
|
||||||
version = "0.12.0"
|
version = "0.13.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://git.asonix.dog/asonix/background-jobs#250d2f0a33369a657563f58b5e8218338a267ec4"
|
||||||
checksum = "82fe510c99cea8b98c438e81f43c666e9b4cd3630a42a1684ed1d01db4271cfb"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-rt",
|
"actix-rt",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-mutex",
|
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
"event-listener",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"time",
|
"time",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-futures",
|
"tracing-futures",
|
||||||
"uuid 0.8.2",
|
"uuid",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2857,7 +2854,7 @@ dependencies = [
|
||||||
"pin-project",
|
"pin-project",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-futures",
|
"tracing-futures",
|
||||||
"uuid 1.1.2",
|
"uuid",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3034,16 +3031,6 @@ version = "0.7.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
|
checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "uuid"
|
|
||||||
version = "0.8.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
|
|
||||||
dependencies = [
|
|
||||||
"getrandom",
|
|
||||||
"serde",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uuid"
|
name = "uuid"
|
||||||
version = "1.1.2"
|
version = "1.1.2"
|
||||||
|
|
|
@ -63,9 +63,10 @@ tracing-subscriber = { version = "0.3", features = [
|
||||||
uuid = { version = "1", features = ["v4", "serde"] }
|
uuid = { version = "1", features = ["v4", "serde"] }
|
||||||
|
|
||||||
[dependencies.background-jobs]
|
[dependencies.background-jobs]
|
||||||
version = "0.12.0"
|
version = "0.13.0"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["background-jobs-actix", "error-logging"]
|
features = ["background-jobs-actix", "error-logging"]
|
||||||
|
git = "https://git.asonix.dog/asonix/background-jobs"
|
||||||
|
|
||||||
[dependencies.http-signature-normalization-actix]
|
[dependencies.http-signature-normalization-actix]
|
||||||
version = "0.6.0"
|
version = "0.6.0"
|
||||||
|
|
|
@ -19,7 +19,10 @@ use crate::{
|
||||||
jobs::process_listeners::Listeners,
|
jobs::process_listeners::Listeners,
|
||||||
requests::Requests,
|
requests::Requests,
|
||||||
};
|
};
|
||||||
use background_jobs::{memory_storage::Storage, Job, Manager, QueueHandle, WorkerConfig};
|
use background_jobs::{
|
||||||
|
memory_storage::{ActixTimer, Storage},
|
||||||
|
Job, Manager, QueueHandle, WorkerConfig,
|
||||||
|
};
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
pub(crate) fn create_workers(
|
pub(crate) fn create_workers(
|
||||||
|
@ -28,7 +31,7 @@ pub(crate) fn create_workers(
|
||||||
media: MediaCache,
|
media: MediaCache,
|
||||||
config: Config,
|
config: Config,
|
||||||
) -> (Manager, JobServer) {
|
) -> (Manager, JobServer) {
|
||||||
let shared = WorkerConfig::new_managed(Storage::new(), move |queue_handle| {
|
let shared = WorkerConfig::new_managed(Storage::new(ActixTimer), move |queue_handle| {
|
||||||
JobState::new(
|
JobState::new(
|
||||||
state.clone(),
|
state.clone(),
|
||||||
actors.clone(),
|
actors.clone(),
|
||||||
|
|
Loading…
Reference in a new issue