MCPcopy Create free account
hub / github.com/DialmasterOrg/Youtarr / addJob

Method addJob

server/modules/jobModule.js:915–937  ·  view source on GitHub ↗
(job)

Source from the content-addressed store, hash-verified

913 }
914
915 async addJob(job) {
916 const jobId = uuidv4(); // Generate a new UUID
917 job.timeInitiated = Date.now();
918 job.timeCreated = Date.now();
919 job.id = jobId;
920 this.jobs[jobId] = job;
921
922 try {
923 // Only save the new job to DB, don't touch other jobs
924 await Job.create({
925 id: jobId,
926 jobType: job.jobType,
927 status: job.status,
928 output: job.output || '',
929 timeInitiated: job.timeInitiated,
930 timeCreated: job.timeCreated,
931 });
932 return jobId;
933 } catch (error) {
934 logger.error({ err: error }, 'Error saving job');
935 throw error;
936 }
937 }
938
939 async updateJob(jobId, updatedFields) {
940 logger.debug({ jobId, status: updatedFields.status }, 'updateJob called');

Callers 2

addOrUpdateJobMethod · 0.95
jobModule.test.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected