loadJobs: Load and maybe enqueue unfinished jobs from the server...

View source: R/loadJobs.R

loadJobsR Documentation

Load and maybe enqueue unfinished jobs from the server database.

Description

A global object Jobs is created, which manages jobs. It is populated from the "jobs" table in the server database.

Usage

loadJobs(which = NULL)

Arguments

which

character scalar or integer scalar, which will be converted to a character scalar. Load only jobs whose top job is in that queue. If NULL (the default), do not actually load or queue any jobs.

Details

It has these fixed fields:

  • type: character; type of job

  • done: integer; 0 if not attempted; negative for errors; +1 for successfully finished

  • queue: integer; the queue to which a job belongs; there is one queue per running processServer(). If queue==0, the job has been enqueued for processing but not yet claimed by one of the processServers(). If queue is null, it is being handled by emailServer() or pathServer()

  • path: full path to folder for job

  • oldpath: full path to previous folder for job (permits recovery from server failure during job move)

  • user: username, when job is the top job from an authenticated email

Other job items are stored in a JSON-encoded text field called data.

For any jobs to be loaded we verify that the "path" field is correct, in case the server was interrupted while moving a job.

Value

the number of jobs enqueued in the new global MOTUS_QUEUE. The Jobs are stored in the global Jobs.

Author(s)

John Brzustowski jbrzusto@REMOVE_THIS_PART_fastmail.fm


MotusWTS/motusServer documentation built on Aug. 8, 2024, 10:23 p.m.