MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / messageHandler

Function messageHandler

dlp/inspectDatastore.js:126–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124 // Watch the Pub/Sub topic until the DLP job finishes
125 await new Promise((resolve, reject) => {
126 const messageHandler = message => {
127 if (message.attributes && message.attributes.DlpJobName === jobName) {
128 message.ack();
129 subscription.removeListener('message', messageHandler);
130 subscription.removeListener('error', errorHandler);
131 resolve(jobName);
132 } else {
133 message.nack();
134 }
135 };
136
137 const errorHandler = err => {
138 subscription.removeListener('message', messageHandler);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected