
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
job-processor
Advanced tools
Le job processor
est un service conçu pour traiter des tâches en arrière-plan de manière efficace et fiable.
Il a été développé pour le template apprentissage Template Apprentissage et est déjà installé et pré-configuré sur celui-ci.
yarn add job-processor
Le job processor s'initialise avec l'import de la fonction initJobProcessor()
:
initJobProcessor({
db: Db
logger: ILogger
jobs: Record<string, JobDef>
crons: Record<string, CronDef>
workerTags?: string[] | null
})
bunyan
est utilisé par défaut sur le template.Les options des jobs permettent de configurer le comportement de chaque tâche individuellement.
JobDef
type JobDef = {
handler: (job: IJobsSimple, signal: AbortSignal) => Promise<unknown>;
onJobExited?: (job: IJobsSimple) => Promise<unknown>;
resumable?: boolean;
tag?: string | null;
};
false
).null
).CronDef
type CronDef = {
cron_string: string;
handler: (signal: AbortSignal) => Promise<unknown>;
onJobExited?: (job: IJobsCronTask) => Promise<unknown>;
resumable?: boolean;
checkinMargin?: number;
maxRuntimeInMinutes?: number;
tag?: string | null;
};
L'ajout de workerTags
permet d'attribuer une ou plusieurs tâches à un worker en particulier.
Par défaut, toutes les tâches peuvent être attribuées à l'ensemble des workers disponibles.
Ajuster la configuration de l'application :
docker-compose.production.yml
, ajouter la variable d'environnement au service job-processor
:environment:
INSTANCE_ID: "runner-{% raw %}{{.Task.Slot}}{% endraw %}"
config.ts
worker: env.get("INSTANCE_ID").asString(),
initJobProcessor()
:workerTags: config.worker === "runner-1" ? ["main"] : ["slave"];
Vous pouvez désormais attribuer un tag à un job :
jobs: {
"my-super-job":{
handler: fn,
tag: "main"
}
}
FAQs
Job processor service
The npm package job-processor receives a total of 27 weekly downloads. As such, job-processor popularity was classified as not popular.
We found that job-processor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.