-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Queue stuff #5
Conversation
type SyncFunction = (je: JobExecution) => Promise<boolean | undefined>; | ||
|
||
const getSyncFunction = (agentType: string): SyncFunction | null => { | ||
if (agentType === JobAgentType.GithubApp) return syncGithubJobExecution; | ||
return null; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
function pRetry( | ||
arg0: () => Promise<number | undefined>, | ||
arg1: { retries: number; minTimeout: number }, | ||
) { | ||
throw new Error("Function not implemented."); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function pRetry( | |
arg0: () => Promise<number | undefined>, | |
arg1: { retries: number; minTimeout: number }, | |
) { | |
throw new Error("Function not implemented."); | |
} |
import it
if (!parsed.success) | ||
throw new Error(`Invalid job agent config for job execution ${je.id}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of throwing errors set a message and set the status to 'invalid_provider', in the db table
|
||
export const configSchema = z.object({ | ||
installationId: z.number(), | ||
login: z.string().min(1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
login: z.string().min(1), | |
owner: z.string().min(1), |
Should this be in @ctrlplane/validators
message: (error as Error).message, | ||
}); | ||
} | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might need a .catch here as well to update status
owner: config.login, | ||
repo: config.repo, | ||
workflow_id: config.workflowId, | ||
ref: "main", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ref: "main", | |
ref: config.ref, |
maybe this configurable?
workflow_id: config.workflowId, | ||
ref: "main", | ||
inputs: { | ||
job_execution_id: je.id.slice(0, 8), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we slice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slicing to get the external run ID because its only the first 8 of the string
apps/event-worker/src/index.ts
Outdated
Promise.all([ | ||
targetScanWorker.close(), | ||
dispatchExecutionJobWorker.close(), | ||
redis.quit(), | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Promise.all makes no difference here if you not await
packages/job-dispatch/src/config.ts
Outdated
AMQP_URL: z.string().optional(), | ||
AMQP_QUEUE: z.string().default("job_configs"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AMQP_URL: z.string().optional(), | |
AMQP_QUEUE: z.string().default("job_configs"), |
queue supremacy