Skip to content

Commit

Permalink
feat(gadget-sdk): improve MultiJobRunner builder (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serial-ATA authored Oct 24, 2024
1 parent 1c8dac4 commit e9c0785
Show file tree
Hide file tree
Showing 4 changed files with 295 additions and 140 deletions.
7 changes: 1 addition & 6 deletions blueprints/incredible-squaring/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ async fn main() {
};

info!("~~~ Executing the incredible squaring blueprint ~~~");
MultiJobRunner::new(&env)
.with_job()
.with_default_price_targets()
.finish(x_square)
.run()
.await?;
MultiJobRunner::new(env).job(x_square).run().await?;

info!("Exiting...");
Ok(())
Expand Down
6 changes: 1 addition & 5 deletions blueprints/periodic-web-poller/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ async fn main() {
};

info!("~~~ Executing the periodic web poller ~~~");
MultiJobRunner::new(None)
.with_job()
.finish(web_poller)
.run()
.await?;
MultiJobRunner::new(None).job(web_poller).run().await?;

info!("Exiting...");
Ok(())
Expand Down
6 changes: 6 additions & 0 deletions sdk/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ pub enum Error {
#[error("Keystore error: {0}")]
Keystore(#[from] crate::keystore::error::Error),

#[error("Config error: {0}")]
Config(#[from] crate::config::Error),

#[error("Job runner error: {0}")]
Runner(#[from] crate::job_runner::Error),

#[error("Missing network ID")]
MissingNetworkId,

Expand Down
Loading

0 comments on commit e9c0785

Please sign in to comment.