Avoid to use "pubsub" for the name of modules, middlewares, variables, etc..

This commit is contained in:
Daniel García Aubert
2020-04-29 10:40:45 +02:00
parent 4e3ef96374
commit 70f0b6ea50
7 changed files with 17 additions and 17 deletions
@@ -2,16 +2,16 @@
const { PubSub } = require('@google-cloud/pubsub');
module.exports = class PubSubMetricsBackend {
module.exports = class MetricsBackend {
constructor (options = {}) {
const { project_id: projectId, credentials: keyFilename, topic } = options;
this._pubsub = new PubSub({ projectId, keyFilename });
this._metricsClient = new PubSub({ projectId, keyFilename });
this._topicName = topic;
}
send (event, attributes) {
const data = Buffer.from(event);
return this._pubsub.topic(this._topicName).publish(data, attributes);
return this._metricsClient.topic(this._topicName).publish(data, attributes);
}
};