Skip to content

diskinfo in setInterval or setTimeout always returns the same value #2

@bsocius

Description

@bsocius

The module always returns the same value, even when the size on disk has changed.

Example:

 var d           = require('diskinfo');

var interval = setTimeout(du, 2500);

function du () {
d.getDrives(function (error, result){
    console.log(result);
});
interval = setTimeout(du, 2500)
}

function stopinterval() {
clearTimeout(interval);

}

/output of the console.log

[ { filesystem: '/dev/loop0',
blocks: '2519792',
used: '2215180',
available: '176612',
capacity: '93%',
mounted: '/' },
{ filesystem: '/dev/block/vold/259:3',
blocks: '12063840',
used: '10099392',
available: '1964448',
capacity: '84%',
mounted: '/mnt/sdcard0' } ]
[ { filesystem: '/dev/loop0',
blocks: '2519792',
used: '2215180',
available: '176612',
capacity: '93%',
mounted: '/' },
{ filesystem: '/dev/block/vold/259:3',
blocks: '12063840',
used: '10099392',
available: '1964448',
capacity: '84%',
mounted: '/mnt/sdcard0' } ]

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