Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d19798dfea | ||
|
|
0812a9be37 | ||
|
|
66649022ca |
@@ -22,6 +22,8 @@ export function issueLabel(config: Config, queue: TaskQueue) {
|
||||
return async (c: Context) => {
|
||||
const event = await c.req.json<IssueEvent>();
|
||||
|
||||
console.log(`[issue-label] action="${event.action}" issue=#${event.issue.number} labels=[${event.issue.labels.map((l) => l.name).join(", ")}]`);
|
||||
|
||||
if (event.action !== "label_updated" && event.action !== "labeled") {
|
||||
return c.text("ignored: not a label event", 200);
|
||||
}
|
||||
|
||||
+3
-3
@@ -158,7 +158,7 @@ export class TaskQueue {
|
||||
"create-workspace",
|
||||
{ task, comment },
|
||||
{
|
||||
jobId: `create:${key}`,
|
||||
jobId: `create-${key}`,
|
||||
attempts: 3,
|
||||
backoff: { type: "exponential", delay: 5000 },
|
||||
},
|
||||
@@ -198,7 +198,7 @@ export class TaskQueue {
|
||||
"cleanup-workspace",
|
||||
{ workspaceId: entry.workspaceId, workspaceName: entry.workspaceName },
|
||||
{
|
||||
jobId: `cleanup:${workspaceName}`,
|
||||
jobId: `cleanup-${workspaceName}`,
|
||||
attempts: 5,
|
||||
backoff: { type: "exponential", delay: 10000 },
|
||||
},
|
||||
@@ -308,7 +308,7 @@ export class TaskQueue {
|
||||
"cleanup-workspace",
|
||||
{ workspaceId: ws.id, workspaceName: ws.name },
|
||||
{
|
||||
jobId: `cleanup:stale-${ws.name}-${Date.now()}`,
|
||||
jobId: `cleanup-stale-${ws.name}-${Date.now()}`,
|
||||
attempts: 5,
|
||||
backoff: { type: "exponential", delay: 10000 },
|
||||
},
|
||||
|
||||
@@ -109,12 +109,14 @@ export class CoderClient {
|
||||
|
||||
async deleteWorkspace(workspaceId: string): Promise<void> {
|
||||
const res = await fetch(
|
||||
`${this.baseUrl}/api/v2/workspaces/${workspaceId}`,
|
||||
`${this.baseUrl}/api/v2/workspaces/${workspaceId}/builds`,
|
||||
{
|
||||
method: "DELETE",
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Coder-Session-Token": this.token,
|
||||
},
|
||||
body: JSON.stringify({ transition: "delete" }),
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user