Skip to content

Commit bbe1922

Browse files
authored
worker: Inline enqueue_with_priority() fns (#9631)
We're not actually using this, so let's call YAGNI and remove it.
1 parent 6fcac60 commit bbe1922

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

crates/crates_io_worker/src/background_job.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,13 @@ pub trait BackgroundJob: Serialize + DeserializeOwned + Send + Sync + 'static {
3939
/// Execute the task. This method should define its logic.
4040
fn run(&self, ctx: Self::Context) -> impl Future<Output = anyhow::Result<()>> + Send;
4141

42-
fn enqueue(
43-
&self,
44-
conn: &mut impl LoadConnection<Backend = Pg>,
45-
) -> Result<Option<i64>, EnqueueError> {
46-
self.enqueue_with_priority(conn, Self::PRIORITY)
47-
}
48-
4942
#[instrument(name = "swirl.enqueue", skip(self, conn), fields(message = Self::JOB_NAME))]
50-
fn enqueue_with_priority(
43+
fn enqueue(
5144
&self,
5245
conn: &mut impl LoadConnection<Backend = Pg>,
53-
priority: i16,
5446
) -> Result<Option<i64>, EnqueueError> {
5547
let data = serde_json::to_value(self)?;
48+
let priority = Self::PRIORITY;
5649

5750
if Self::DEDUPLICATED {
5851
Ok(enqueue_deduplicated(conn, Self::JOB_NAME, &data, priority)?)

0 commit comments

Comments
 (0)