How to use the koop/lib.DataCache function in koop

To help you get started, we’ve selected a few koop examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github koopjs / koop-provider-agol / workers / request-worker.js View on Github external
var pgcache = require('koop-pgcache')
var config = require('config')
var http = require('http')
var https = require('https')
var util = require('util')

// set global number of sockets if in the config
// node version > 0.12 sets max sockets to infinity
if (config.sockets) {
  http.globalAgent.maxSockets = Math.floor(config.sockets / 2)
  https.globalAgent.maxSockets = Math.floor(config.sockets / 2)
}

// Init Koop with things it needs like a log and Cache
koop.log = new koop.Logger(config)
koop.Cache = new koop.DataCache(koop)

// registers a DB modules
koop.Cache.db = pgcache.connect(config.db.conn, koop)

// Create the job queue for this worker process
// connects to the redis same redis
var jobs = kue.createQueue({
  prefix: config.redis.prefix,
  redis: {
    port: config.redis.port,
    host: config.redis.host
  }
})

process.once('SIGINT', function (sig) {
  jobs.active(function (err, ids) {

koop

Serve, transform, and query geospatial data on the web

Apache-2.0
Latest version published 2 years ago

Package Health Score

43 / 100
Full package analysis