SkySpark by SkyFoundry

ext job

jobCancel

jobCancel(handle)

Send the cancel message to the job identified by given handle. Throw Err if job ext not installed.

Side effects:

  • changes job status of given job
jobCurRec

jobCurRec(checked: true)

If running in the context of a scheduled job then return the job record Dict. Otherwise raise an error or return null based on the checked flag.

jobFolioCompact

jobFolioCompact()

Run the folioCompact function as a background job. Unlike the core function, this function runs synchronously and updates the job progress based on compaction progress. Raise an exception if this function is not called while running in a job.

jobFolioSnapshot

jobFolioSnapshot()

Run the folioSnapshot function as a background job. Unlike the core function, this function runs synchronously and updates the job progress based on snapshot progress. Raise an exception if this function is not called while running in a job.

jobIsRunning

jobIsRunning()

Is the current context contained by a running job.

jobLog

jobLog(handle)

Return the LogRecs logged by the job identified by handle. Throw Err if job ext not installed or handle does map to a valid job. Columns:

  • ts: timestamp of log item
  • level: err, warn, info, debug
  • msg: message of LogRec
  • errTrace: dump if there was an exception
jobProgress

jobProgress(percent, msg)

Update the current job's progress with percent complete and display message for current activity. If the current context is not actively running inside a job, this is a no-op.

jobRun

jobRun(expr)

Run the given expression in the context of a background job. If the expression evaluates to a Ref which references a job record, then run that job.

The job is run in the background using admin permissions.

See jobExt.

jobSleep

jobSleep(dur)

Sleep for the given duration. If the current context is not actively running inside a job, this is a no-op.

Side effects:

  • pauses the job for the given duration
jobStatus

jobStatus(handle)

Return the status for a single job identified by handle. Throw Err if job ext not installed or handle does map to a valid job. Columns:

  • handle: unique id for job
  • jobStatus: pending, running, cancelling, doneCancel, doneErr, doneOk
  • dis: summary display of job
  • progress: integer percent complete between 0 and 100
  • progressMsg: current progress activity
  • started: datetime job was started or null if not run yet
  • runtime: duration of job run
jobStatusAll

jobStatusAll()

Return the status for all the known jobs. Throw Err if job ext not installed. Result grid uses same format as jobStatus.