Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Remove Result from WebhookConsumer::new
Browse files Browse the repository at this point in the history
  • Loading branch information
bretthoerner committed Dec 15, 2023
1 parent c00bc04 commit 9084c6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions hook-consumer/src/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl<'p> WebhookConsumer<'p> {
poll_interval: time::Duration,
request_timeout: time::Duration,
max_concurrent_jobs: usize,
) -> Result<Self, WebhookConsumerError> {
) -> Self {
let mut headers = header::HeaderMap::new();
headers.insert(
header::CONTENT_TYPE,
Expand All @@ -45,13 +45,13 @@ impl<'p> WebhookConsumer<'p> {
.build()
.expect("failed to construct reqwest client for webhook consumer");

Ok(Self {
Self {
name: name.to_owned(),
queue,
poll_interval,
client,
max_concurrent_jobs,
})
}
}

/// Wait until a job becomes available in our queue.
Expand Down Expand Up @@ -333,8 +333,8 @@ mod tests {
time::Duration::from_millis(100),
time::Duration::from_millis(5000),
10,
)
.expect("consumer failed to initialize");
);

let consumed_job = consumer
.wait_for_job()
.await
Expand Down
2 changes: 1 addition & 1 deletion hook-consumer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<(), WebhookConsumerError> {
config.poll_interval.0,
config.request_timeout.0,
config.max_concurrent_jobs,
)?;
);

let _ = consumer.run().await;

Expand Down

0 comments on commit 9084c6e

Please sign in to comment.