fix: ability to run without redis

This commit is contained in:
Ludo Galabru
2023-05-19 09:11:40 -04:00
parent debb06cd5c
commit 96825c35a8

View File

@@ -38,7 +38,17 @@ impl Service {
let mut chainhook_config = ChainhookConfig::new();
if predicates.is_empty() {
let registered_predicates = load_predicates_from_redis(&self.config, &self.ctx)?;
let registered_predicates = match load_predicates_from_redis(&self.config, &self.ctx) {
Ok(predicates) => predicates,
Err(e) => {
error!(
self.ctx.expect_logger(),
"Failed loading predicate from storage: {}",
e.to_string()
);
vec![]
}
};
for predicate in registered_predicates.into_iter() {
let predicate_uuid = predicate.uuid().to_string();
match chainhook_config.register_specification(predicate, true) {