Skip to content

intervalCb results grow forever #9

Description

@sean256

I noticed you are always appending new keys to the same {} for results. This can grow to an unruly size and pretty quickly if left alone for awhile.

May I suggest you only return the results for the single interval? Leave it up to us users to reconcile if we need to.

If anyone else is wanting a quick solve here is what I did

const intervalCb = (err, results) => {
		if (err) {
			console.log(err);
		} else {
			console.log(results);
			// delete the key in the object. It's passed by reference so we can clean it up here.
			const key = Object.keys(results)[0];
			delete results[key];
		}
	},

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