Tech Team
Tech Team

Reputation: 119

High CPU usage with grunt 1.0.3 and sailsjs

Here's my watch.js file :

module.exports = function (grunt) {

grunt.config.set('watch', {
assets: {

  // Assets to watch:
  files: [
    'assets/**/*',
    'tasks/pipeline.js',
    '!**/node_modules/**',
    '!assets/images/**' // <- Added this line to stop watching
  ],

  // When assets are changed:
  tasks: [
    'syncAssets',
    'linkAssets'
  ]
}
});

I followed this to reduce the folder grunt watches for change but to no avail. Also, I deleted the task folder along with Gruntfile.js file to stop using grunt but doing htop on the server still shows grunt hogging the cpu.

Upvotes: 1

Views: 647

Answers (1)

Adrij Shikhar
Adrij Shikhar

Reputation: 13

Add this in the watch script options : { interval: 1000 } in Gruntfile.js

Upvotes: 0

Related Questions