Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test failing "shouldn\'t raise two events for one change" #15

Open
gforceg opened this issue Apr 13, 2017 · 2 comments
Open

test failing "shouldn\'t raise two events for one change" #15

gforceg opened this issue Apr 13, 2017 · 2 comments

Comments

@gforceg
Copy link
Owner

gforceg commented Apr 13, 2017

fix failing test
change to a file raises multiple 'change' events.

@AdamMarciniak
Copy link

AdamMarciniak commented Jan 15, 2020

Same thing is happening to me. I'm doing something like this to add/change a file.

if (part.filename !== '' && part.mimeType === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') {
                            console.log(part)
                            gmail.users.messages.attachments.get({
                                userId: 'me',
                                messageId: id,
                                id: part.body.attachmentId
                            }, (err, { data }) => {
                                if (err) return console.log('Error getting attachment: ' + err);
                                fs.writeFile('./received_files/' + part.filename, data['data'], { encoding: 'base64' }, (err) => console.log(err));

                            });

It's giving me two change events even though it's only changing the file once.

@benzmuircroft
Copy link

yeah it's happening to me also

    var newblock=hound.watch(__dirname+'/block/latest');
        newblock.on('change',function(filename){
            filename=filename.split('block/')[1];
            log(filename);
            if(filename.indexOf('.')==-1){
                fs.readFile(__dirname+'/block/'+filename,'utf-8',function(e,block){
                    log('b...');
                    if(catchingup!=='waiting'&&resyncing==false){setTimeout(delay_block,10000,block);}
                    });
                }
            });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants