4.0.3 • Published 10 years ago

tfk-saksbehandling-queue-pull v4.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

Build Status js-standard-style

tfk-saksbehandling-queue-pull

Pulls next job from the saksbehandling queue and saves it as a .json-file in a directory of your choice.

Sends statusupdate to the systemlog,

Installation

From npm

$ npm install tfk-saksbehandling-queue-pull

from github

$ git clone git@github.com:telemark/tfk-saksbehandling-queue-pull.git

cd into directory and run setup

$ npm run setup

Usage

'use strict'

var pullFromQueue = require('tfk-saksbehandling-queue-pull')
var options = {
  key: 'NeverShareYourSecret',
  payload: {
    system: 'tfk-saksbehandling-queue-pull'
  },
  jobFolderPath: 'jobs/',
  queueNextUrl: 'https://yoursystem.com/api/queue/next',
  deleteFromQueueUrl: 'https://yoursystem.com/api/queue',
  statusMessage: 'Ready for next step'
}

pullFromQueue(options, function (error, data) {
  if (error) {
    console.error(error)
  } else {
    console.log(data)
  }
})

If no jobs in queue it returns

{ message: 'No job in queue' }

else

{ message: 'Job 56b79dc6139e6bf1069ae22d downloaded. Status updated.' }

Docker

Build

$ docker build -t tfk-saksbehandling-queue-pull .

Usage

$ docker run --env-file=docker.env --volume=/test/data/jobs:/src/test/data/jobs --rm tfk-saksbehandling-queue-pull

This will start a container. Download a job. Stop the container and remove it.

License

MIT

4.0.3

10 years ago

4.0.2

10 years ago

4.0.1

10 years ago

4.0.0

10 years ago

3.0.1

10 years ago

3.0.0

10 years ago

2.0.2

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago