Documentation ¶
Index ¶
- func AddJob(idPrefix string, jobType protos.JobStatus_JobType, jobItemId string, ...) (*protos.JobStatus, error)
- func CompleteJob(jobId string, success bool, message string, outputFilePath string, ...) error
- func ListenForExternalTriggeredJobs(prefix string, callback func(*protos.JobStatus), db *mongo.Database, ...)
- func UpdateJob(jobId string, status protos.JobStatus_Status, message string, logId string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddJob ¶
func AddJob(idPrefix string, jobType protos.JobStatus_JobType, jobItemId string, jobTimeoutSec uint32, db *mongo.Database, idgen idgen.IDGenerator, ts timestamper.ITimeStamper, logger logger.ILogger, sendUpdate func(*protos.JobStatus)) (*protos.JobStatus, error)
Expected to be called by API to create the initial record of a job. It can then trigger it however it needs to (eg AWS lambda or running PIQUANT nodes) and this sticks around monitoring the DB entry for changes, calling the sendUpdate callback function on change. Returns the snapshot of the "added" job that was saved
func CompleteJob ¶
func CompleteJob(jobId string, success bool, message string, outputFilePath string, otherLogFiles []string, db *mongo.Database, ts timestamper.ITimeStamper, logger logger.ILogger) error
Expected to be called from the thing running the job. This allows setting some output fields
func UpdateJob ¶
func UpdateJob(jobId string, status protos.JobStatus_Status, message string, logId string, db *mongo.Database, ts timestamper.ITimeStamper, logger logger.ILogger) error
Expected to be called from the thing running the job. This updates the DB status, which hopefully the go thread started by AddJob will notice and fire off an update
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.