File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ pub async fn run_scheduled_jobs(db: &DbClient) -> anyhow::Result<()> {
207
207
208
208
match handle_job ( & job. name , & job. metadata ) . await {
209
209
Ok ( _) => {
210
- tracing:: trace!( "job succesfully executed (id={})" , job. id) ;
210
+ tracing:: trace!( "job successfully executed (id={})" , job. id) ;
211
211
delete_job ( & db, & job. id ) . await ?;
212
212
}
213
213
Err ( e) => {
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ pub async fn get_job_by_name_and_scheduled_at(
93
93
. await
94
94
. context ( "Select job by name and scheduled at" ) ?;
95
95
96
- serialize_job ( & job)
96
+ deserialize_job ( & job)
97
97
}
98
98
99
99
// Selects all jobs with:
@@ -111,14 +111,14 @@ pub async fn get_jobs_to_execute(db: &DbClient) -> Result<Vec<Job>> {
111
111
112
112
let mut data = Vec :: with_capacity ( jobs. len ( ) ) ;
113
113
for job in jobs {
114
- let serialized_job = serialize_job ( & job) ;
114
+ let serialized_job = deserialize_job ( & job) ;
115
115
data. push ( serialized_job. unwrap ( ) ) ;
116
116
}
117
117
118
118
Ok ( data)
119
119
}
120
120
121
- fn serialize_job ( row : & tokio_postgres:: row:: Row ) -> Result < Job > {
121
+ fn deserialize_job ( row : & tokio_postgres:: row:: Row ) -> Result < Job > {
122
122
let id: Uuid = row. try_get ( 0 ) ?;
123
123
let name: String = row. try_get ( 1 ) ?;
124
124
let scheduled_at: DateTime < Utc > = row. try_get ( 2 ) ?;
Original file line number Diff line number Diff line change 35
35
36
36
use crate :: db:: jobs:: JobSchedule ;
37
37
38
- // Cadence in seconds with which the jobs will be scheduled
38
+ // How often new cron-based jobs will be placed in the queue.
39
+ // This is the minimum period *between* a single cron task's executions.
39
40
pub const JOB_SCHEDULING_CADENCE_IN_SECS : u64 = 1800 ;
40
41
41
- // Cadence in seconds with which the jobs will be processed
42
+ // How often the database is inspected for jobs which need to execute.
43
+ // This is the granularity at which events will occur.
42
44
pub const JOB_PROCESSING_CADENCE_IN_SECS : u64 = 60 ;
43
45
44
46
pub fn jobs ( ) -> Vec < JobSchedule > {
You can’t perform that action at this time.
0 commit comments