14
14
15
15
use std:: sync:: Arc ;
16
16
17
- use apalis_core:: { executor:: TokioExecutor , layers:: extensions:: Extension , monitor:: Monitor } ;
17
+ use apalis:: prelude:: { Monitor , TokioExecutor } ;
18
+ use apalis_core:: layers:: extensions:: Extension ;
18
19
use mas_email:: Mailer ;
19
20
use mas_matrix:: HomeserverConnection ;
20
21
use mas_storage:: { BoxClock , BoxRepository , Repository , SystemClock } ;
@@ -95,7 +96,7 @@ trait JobContextExt {
95
96
fn state ( & self ) -> State ;
96
97
}
97
98
98
- impl JobContextExt for apalis_core :: context :: JobContext {
99
+ impl JobContextExt for apalis :: prelude :: JobContext {
99
100
fn state ( & self ) -> State {
100
101
self . data_opt :: < State > ( )
101
102
. expect ( "state not injected in job context" )
@@ -109,21 +110,19 @@ macro_rules! build {
109
110
let storage = $factory. build( ) ;
110
111
let worker_name = format!(
111
112
"{job}-{suffix}" ,
112
- job = <$job as :: apalis_core :: job :: Job >:: NAME ,
113
+ job = <$job as :: apalis :: prelude :: Job >:: NAME ,
113
114
suffix = $suffix
114
115
) ;
115
116
116
- let builder = :: apalis_core :: builder :: WorkerBuilder :: new( worker_name)
117
+ let builder = :: apalis :: prelude :: WorkerBuilder :: new( worker_name)
117
118
. layer( $state. inject( ) )
118
119
. layer( crate :: utils:: trace_layer( ) )
119
120
. layer( crate :: utils:: metrics_layer( ) ) ;
120
121
121
- let builder = :: apalis_core:: storage:: builder:: WithStorage :: with_storage_config(
122
- builder,
123
- storage,
124
- |c| c. fetch_interval( std:: time:: Duration :: from_secs( 1 ) ) ,
125
- ) ;
126
- :: apalis_core:: builder:: WorkerFactory :: build( builder, :: apalis_core:: job_fn:: job_fn( $fn) )
122
+ let builder = :: apalis:: prelude:: WithStorage :: with_storage_config( builder, storage, |c| {
123
+ c. fetch_interval( std:: time:: Duration :: from_secs( 1 ) )
124
+ } ) ;
125
+ :: apalis:: prelude:: WorkerFactory :: build( builder, :: apalis:: prelude:: job_fn( $fn) )
127
126
} } ;
128
127
}
129
128
0 commit comments