aboutsummaryrefslogtreecommitdiffstats
path: root/crates/rule-executor/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/rule-executor/src/main.rs')
-rw-r--r--crates/rule-executor/src/main.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/crates/rule-executor/src/main.rs b/crates/rule-executor/src/main.rs
index 18c9222..abae26d 100644
--- a/crates/rule-executor/src/main.rs
+++ b/crates/rule-executor/src/main.rs
@@ -1,4 +1,5 @@
mod cnfg;
+
mod processor;
mod state;
@@ -45,6 +46,9 @@ async fn main() -> Result<()> {
.nats_jetstream(&config.nats)
.await
.inspect_err(|e| error!("nats: {e}"))?
+ .postgres(&config.database)
+ .await
+ .inspect_err(|e| error!("postgres: {e}"))?
.build();
let jetstream = services
@@ -52,7 +56,15 @@ async fn main() -> Result<()> {
.take()
.ok_or_else(|| anyhow::anyhow!("jetstream is not ready"))?;
- let services = state::Services { jetstream };
+ let postgres = services
+ .postgres
+ .take()
+ .ok_or_else(|| anyhow::anyhow!("database is not ready"))?;
+
+ let services = state::Services {
+ jetstream,
+ postgres,
+ };
processor::serve(services, config, provider)
.await