Skip to content

Commit 31b02ca

Browse files
committed
crates-admin: Add command to enqueue OpenGraph image generation jobs
1 parent 037f658 commit 31b02ca

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/bin/crates-admin/enqueue_job.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ pub enum Command {
3434
#[arg()]
3535
name: String,
3636
},
37+
/// Generate OpenGraph images for the specified crates
38+
GenerateOgImage {
39+
/// Crate names to generate OpenGraph images for
40+
#[arg(required = true)]
41+
names: Vec<String>,
42+
},
3743
ProcessCdnLogQueue(jobs::ProcessCdnLogQueue),
3844
SyncAdmins {
3945
/// Force a sync even if one is already in progress
@@ -143,6 +149,11 @@ pub async fn run(command: Command) -> Result<()> {
143149

144150
jobs::CheckTyposquat::new(&name).enqueue(&mut conn).await?;
145151
}
152+
Command::GenerateOgImage { names } => {
153+
for name in names {
154+
jobs::GenerateOgImage::new(name).enqueue(&mut conn).await?;
155+
}
156+
}
146157
Command::SendTokenExpiryNotifications => {
147158
jobs::SendTokenExpiryNotifications
148159
.enqueue(&mut conn)

0 commit comments

Comments
 (0)