Giter Site home page Giter Site logo

caterpillar's Introduction

名字由来

caterpillar => 毛毛虫,意为多任务执行队列,防止正在执行的任务堆积,影响系统性能

用法

加入队列

bin/caterpillar node 1.js

当执行命令里有输出重定向时,要用字符串,如: bin/caterpillar 'node 1.js >> 1.log'

执行

在计划任务里添加 */1 * * * * /usr/bin/flock -xn /var/run/watcherCallback.lock -c 'bin/caterpillar RUN'

要确保锁文件存在且计划任务用户有可写权限


日志说明

  • logs/20160506.log 为队列日志文件
  • logs/deal_20160506.log 为队列处理日志文件
  • logs/stat.json 为队列处理状态文件

此文件不可删除


特殊说明

根据服务器资源使用情况可适当调整index.jsNUM_MAX_QUEUE(最多同时执行的任务队列默认为50)

caterpillar's People

Contributors

tonny-zhang avatar

Watchers

James Cloos avatar fc13240@gmail.com avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.