Skip to content

diskinfo in setInterval repeat the previous value #5

@mawen741

Description

@mawen741

Example:

const diskinfo = require('diskinfo');
setInterval(function(){
 diskinfo.getDrives(function(err, aDrives) {
  		if(!err){
  			  console.log(aDrives)
  		}
 });
},2000)

/output of the console.log after repeat twice
[ { filesystem: '/dev/mapper/vg_root-LogVol01',
blocks: '36819652',
used: '28908684',
available: '6033976',
capacity: '83%',
mounted: '/' },
{ filesystem: 'tmpfs',
blocks: '16441032',
used: '28964',
available: '16412068',
capacity: '1%',
mounted: '/dev/shm' } ]
[ { filesystem: '/dev/mapper/vg_root-LogVol01',
blocks: '36819652',
used: '28908684',
available: '6033976',
capacity: '83%',
mounted: '/' },
{ filesystem: 'tmpfs',
blocks: '16441032',
used: '28964',
available: '16412068',
capacity: '1%',
mounted: '/dev/shm' },
{ filesystem: '/dev/mapper/vg_root-LogVol01',
blocks: '36819652',
used: '28908684',
available: '6033976',
capacity: '83%',
mounted: '/' },
{ filesystem: 'tmpfs',
blocks: '16441032',
used: '28964',
available: '16412068',
capacity: '1%',
mounted: '/dev/shm' } ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions