
Research
/Security News
Popular npm Packages in the keyv and Cacheable Namespaces Compromised in Active Supply Chain Attack
Popular npm packages keyv and cacheable compromised.
[![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][codecov-image]][codecov-url] [![David deps][david-image]][david-url] [![Known Vulnerabilities][snyk-image]][snyk-url] [![npm download][download-image]][down
$ npm i egg-locker --save
// {app_root}/config/plugin.js
exports.locker = {
enable: true,
package: 'egg-locker',
};
// {app_root}/config/config.default.js
exports.locker = {
//redisName: 'lock',//egg-redis的实例名称,多实例的时候需要配置
errorMessage: '系统繁忙,请稍后再试',
maxListenerCount: 2000,
keyPrefix:'lk:'
};
see config/config.default.js for more detail.
// app/controller/index.js
const BaseController = require('egg').Controller
class Controller extends BaseController {
async home(){
const orderid = 'xxxxx'
//并发控制的方法,相同的orderid只有一个调用者能获得锁并进入,其他调用者会等待锁的释放
await this.ctx.runInLock(orderid,async ()=>{
await doSomething()
})
}
}
Please open an issue here.
FAQs
[![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][codecov-image]][codecov-url] [![David deps][david-image]][david-url] [![Known Vulnerabilities][snyk-image]][snyk-url] [![npm download][download-image]][down
The npm package egg-locker receives a total of 3 weekly downloads. As such, egg-locker popularity was classified as not popular.
We found that egg-locker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Popular npm packages keyv and cacheable compromised.

Security News
A misconfiguration gave three Anthropic models internet access, and one, believing it was in a simulation, shipped a credential-stealing package to PyPI.

Security News
/Company News
Socket has joined the new Composer and Packagist sponsorship program as a launch sponsor, supporting the team that keeps PHP's package ecosystem secure.