Skip to content

Commit

Permalink
wordsmithing
Browse files Browse the repository at this point in the history
  • Loading branch information
naps62 committed Dec 3, 2023
1 parent 8652600 commit 1340e03
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,19 @@ async fn main() -> Result<()> {

let config = Config::read()?;

// set up a few random things
let (account_tx, account_rx) = mpsc::unbounded_channel();
let (job_tx, job_rx) = mpsc::unbounded_channel();
let db = Db::connect(&config, account_tx, job_tx).await?;
let chain = db.setup_chain(&config.chain).await?;
let token = CancellationToken::new();

// setup each task
let token = CancellationToken::new();
let sync = Forward::new(db.clone(), &config, chain, account_rx, token.clone()).await?;
let backfill = BackfillManager::new(db.clone(), &config, job_rx, token.clone());
let api = config.http.map(|c| api::start(db.clone(), c));

// spawn and track all tasks
// spawn and tasks and track them
let tracker = TaskTracker::new();
tracker.spawn(sync.run());
tracker.spawn(backfill.run());
Expand Down

0 comments on commit 1340e03

Please sign in to comment.