Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).then(() => {
assert.equal(events, 6, "subscriber called too many times");
assert.equal(handlers, 5, "callback called too many times");
channel.unsubscribe("postgres", counter);
}).then(done, done);
});
afterEach((done) => {
channel.unsubscribe("postgres", listener);
actual = null;
client.end(done);
});
export function enable(enabled: boolean, client: Client) {
if (enabled) {
if (clients.length === 0) {
channel.subscribe("mysql", subscriber);
};
clients.push(client);
} else {
clients = clients.filter((c) => c != client);
if (clients.length === 0) {
channel.unsubscribe("mysql", subscriber);
}
}
}
export function enable(enabled: boolean, client: TelemetryClient) {
if (enabled) {
if (clients.length === 0) {
channel.subscribe("postgres", subscriber);
};
clients.push(client);
} else {
clients = clients.filter((c) => c != client);
if (clients.length === 0) {
channel.unsubscribe("postgres", subscriber);
}
}
}
export function enable(enabled: boolean, client: TelemetryClient) {
if (enabled) {
if (clients.length === 0) {
channel.subscribe("mongodb", subscriber);
};
clients.push(client);
} else {
clients = clients.filter((c) => c != client);
if (clients.length === 0) {
channel.unsubscribe("mongodb", subscriber);
}
}
}
export function dispose() {
channel.unsubscribe("console", subscriber);
clients = [];
}
export function enable(enabled: boolean, client: Client) {
if (enabled) {
if (clients.length === 0) {
channel.subscribe("redis", subscriber);
};
clients.push(client);
} else {
clients = clients.filter((c) => c != client);
if (clients.length === 0) {
channel.unsubscribe("redis", subscriber);
}
}
}
export function enable(enabled: boolean, client: TelemetryClient) {
if (enabled) {
if (clients.length === 0) {
channel.subscribe("winston", subscriber);
};
clients.push(client);
} else {
clients = clients.filter((c) => c != client);
if (clients.length === 0) {
channel.unsubscribe("winston", subscriber);
}
}
}
export function dispose() {
channel.unsubscribe("winston", subscriber);
clients = [];
}
export function enable(enabled: boolean, client: TelemetryClient) {
if (enabled) {
if (clients.length === 0) {
channel.subscribe("azure-coretracing", subscriber);
};
clients.push(client);
} else {
clients = clients.filter((c) => c != client);
if (clients.length === 0) {
channel.unsubscribe("azure-coretracing", subscriber);
}
}
}