const deleteConfiguration = uid => { const storeKey = uidToStoreKey(uid); return storeUtils.deleteKey(storeKey); }
module.exports.deleteKey(keys, architecture, function(err) { if (err) { return reject(err) } else { return resolve() } })
const deleteKeys = (cacheKeyPrefix, redisClient) => { return scanKeys(cacheKeyPrefix, redisClient).then((keys) => { return Promise.all(keys.map((key) => deleteKey(key, redisClient))); }); }
links.map(data => { linksJSON.push({ clicks: data.clicks, limit: data.limit, tags: data.tags, deleteKey: data.deleteKey, url: data.url, code: data.code, createdAt: data.createdAt, updatedAt: data.updatedAt }); });
const onDispose = (key) => { deleteKey(getRedisKey(cacheKeyPrefix, key), redisClient) .then(() => { cacheInstance.log.debug(`deleting key ${key} from redis (evicted by lru-cache)`); }) .catch((err) => { cacheInstance.log.error(err); }); }
/** * User delete key from the current json body in request */ Then(/^\(api\) user deletes key '(.*)'$/, (keyPath) => { const key = common.getTreatedValue(keyPath); // delete the key in json jsonparser.init(JSON.parse(api.requestContent)); jsonparser.deleteKey(key); // update the value in request content file api.requestContent = JSON.stringify(jsonparser.jsonObj); });
app.get('/api/remove_server', function (req, res) { let name = req.query.name; if (!name) throw new Error('Missing parameters'); ch._getConf(); ch.deleteKey(`servers.${name}`); res.json('success'); });
// hooks.afterUpdate /** * When a publihsed aspect is deleted. Delete its entry in the aspectStore * and the sampleStore if any. * Delete multiple possible sample entries in the sample master * list of index and the related sample hashes. Deletes aspect * name from subject-to-aspect resource maps. Deletes aspect-to- * subject resource map with aspect name as key. * * @param {Aspect} inst - The deleted instance * @returns {Promise} */ afterDestroy(inst /* , opts */) { return Promise.join( redisOps.batchCmds() .deleteKey(aspectType, inst.name) .removeKeysForAspect(inst) .exec(), u.removeAspectRelatedSamples(inst.dataValues, seq), inst.isPublished && publishObject(inst, aspectEventNames.del), ); }
describe('-> deleteKey', () => { let redisClient; let delSpy; it('should delete keys', () => { const p = (key, cb) => cb(null, 'ok'); delSpy = sinon.spy(p); redisClient = mockRedisFactory({ del: delSpy })(); return deleteKey('testkey', redisClient, dummyLog).then((result) => { expect(delSpy.called).to.equal(true); expect(result).to.equal('ok'); }); }); it('should reject if an error occurrs keys', () => { const p = (key, cb) => cb(new Error('not ok'), null); delSpy = sinon.spy(p); redisClient = mockRedisFactory({ del: delSpy })(); return deleteKey('testkey', redisClient, dummyLog).catch((err) => { expect(delSpy.called).to.equal(true); expect(err).to.be.an(Error); }); }); });
const del = (key, next) => { return deleteKey(getRedisKey(cacheKeyPrefix, key), redisClient).then(() => { next(key); }); }
uploads.map(data => { uploadsJSON.push({ uploaded: data.uploaded, type: data.type, tags: data.tags, uploadedAt: data.uploadedAt, fileName: data.fileName, deleteKey: data.deleteKey, size: data.size }); zip.addLocalFile( path.join( __dirname, `../public/u/${data.fileName + data.fileExtension}` ), 'uploads' ); })
// removeRelatedSamples /** * Deletes the subject entry AND multiple possible sample entries from the * redis sample store. The following are deleted * 1. subject entry in samsto:subjects (samsto:subject:absolutePath) * 2. subject hash samsto:subject:absolutePath * 3. subject to aspect mapping -> samsto:subaspmap:absolutePath * 4. sample entry in samsto:samples (samsto:samples:absolutePath|*) * 5. sample hash samsto:samples:absolutePath|* * * @param {Object} subject - The subject object * @param {Object} seq - The sequelize object * @returns {Promise} */ function removeFromRedis(subject, seq) { return Promise.join( redisOps.removeKeysForSubject(subject), redisOps.deleteKey(subjectType, subject.absolutePath), removeRelatedSamples(subject, seq), ); }
const deleteConfiguration = uid => { const storeKey = uidToStoreKey(uid); return storeUtils.deleteKey(storeKey); }
deleteConfiguration(uid) { const storeKey = uidToStoreKey(uid); return storeUtils.deleteKey(storeKey); }
deleteConfiguration(uid) { const storeKey = uidToStoreKey(uid); return storeUtils.deleteKey(storeKey); }