Using constant
This commit is contained in:
@@ -106,6 +106,8 @@ fn generate_auth(
|
|||||||
params.insert("RiskCheck", "enable");
|
params.insert("RiskCheck", "enable");
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const DEFAULT_SCHEDULING_SECONDS: i64 = 300;
|
||||||
|
|
||||||
fn is_scheduleable(
|
fn is_scheduleable(
|
||||||
now: &Option<time::OffsetDateTime>,
|
now: &Option<time::OffsetDateTime>,
|
||||||
scheduled: &Option<time::OffsetDateTime>,
|
scheduled: &Option<time::OffsetDateTime>,
|
||||||
@@ -114,7 +116,7 @@ fn is_scheduleable(
|
|||||||
Some(schedule_at) => {
|
Some(schedule_at) => {
|
||||||
let early = now
|
let early = now
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.checked_add(time::Duration::seconds(300))
|
.checked_add(time::Duration::seconds(DEFAULT_SCHEDULING_SECONDS))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
*schedule_at > early
|
*schedule_at > early
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user