diff options
author | Vincent Ambo <tazjin@gmail.com> | 2018-04-14T20·05+0200 |
---|---|---|
committer | Vincent Ambo <github@tazj.in> | 2018-04-14T20·21+0200 |
commit | 39d1cd64bc5ffe250dc2a30d05d0b6312e7abbc1 (patch) | |
tree | 8b364010a51f01e1df06908f403162b5ffceddbf /src/errors.rs | |
parent | 3e5b1098c6ae2852ea2df37b7c292cb37d5b1e84 (diff) |
feat(main/db): Schedule regular search view refresh
Schedules refreshes of the database view used for search at one-minute intervals.
Diffstat (limited to 'src/errors.rs')
-rw-r--r-- | src/errors.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/errors.rs b/src/errors.rs index c7c1e14f4312..9de907430d6e 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -30,6 +30,7 @@ use diesel; use r2d2; use reqwest; use tera; +use tokio_timer; pub type Result<T> = result::Result<T, ConverseError>; @@ -50,6 +51,9 @@ pub enum ConverseError { #[fail(display = "error occured during request handling: {}", error)] ActixWeb { error: actix_web::Error }, + #[fail(display = "error occured running timer: {}", error)] + Timer { error: tokio_timer::Error }, + // This variant is used as a catch-all for wrapping // actix-web-compatible response errors, such as the errors it // throws itself. @@ -99,6 +103,12 @@ impl From<reqwest::Error> for ConverseError { } } +impl From<tokio_timer::Error> for ConverseError { + fn from(error: tokio_timer::Error) -> ConverseError { + ConverseError::Timer { error } + } +} + // Support conversion of error type into HTTP error responses: impl ResponseError for ConverseError { |