Skip to content

Commit

Permalink
Revert "change hook timeout from Option<int64> to Option<time::Durati…
Browse files Browse the repository at this point in the history
…on>"

This reverts commit 36cf113.

The hook timeout should be i64, not Duration. Duration implies a much
finer structure, but the field indicates specifically the number of
seconds before timeout. Duration is not the right choice here.
Reverting back to i64.
  • Loading branch information
yihuaf committed Oct 5, 2021
1 parent f45fc12 commit 81d931e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/runtime/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use derive_builder::Builder;
use getset::{CopyGetters, Getters};
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
use std::time::Duration;

#[derive(Builder, Clone, Debug, Default, Deserialize, Eq, Getters, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
Expand Down Expand Up @@ -99,6 +98,7 @@ pub struct Hook {

#[serde(default, skip_serializing_if = "Option::is_none")]
#[getset(get_copy = "pub")]
/// Timeout is the duration before aborting the hook.
timeout: Option<Duration>,
/// Timeout is the number of seconds before aborting the hook. If set,
/// timeout MUST be greater than zero.
timeout: Option<i64>,
}

0 comments on commit 81d931e

Please sign in to comment.