Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bonniernews/b0rker

Package Overview
Dependencies
Maintainers
35
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bonniernews/b0rker - npm Package Compare versions

Comparing version 9.2.2 to 9.3.0

52

lib/cloud-tasks/publish-task.js

@@ -10,14 +10,19 @@ import { CloudTasksClient } from "@google-cloud/tasks";

const { queues, selfUrl, localPort } = config.cloudTasks || {};
const cloudTasksClient = new CloudTasksClient(
localPort
? {
port: localPort,
servicePath: "localhost",
sslCreds: gax.ChannelCredentials.createInsecure(),
}
: {},
gax
);
const { queues, selfUrl, localPort, useHttpFallback } = config.cloudTasks || {};
const cloudTasksClient = getCloudTasksClient();
function getCloudTasksClient() {
if (useHttpFallback) return new CloudTasksClient({ fallback: true });
return new CloudTasksClient(
localPort
? {
port: localPort,
servicePath: "localhost",
sslCreds: gax.ChannelCredentials.createInsecure(),
}
: {},
gax
);
}
// Google recommends to rate limit the amount of published tasks per second

@@ -61,15 +66,18 @@ const maxTasksPublishedPerSecond = 500;

logger.info(`Sending task ${JSON.stringify(body)} with headers ${JSON.stringify(newHeaders)} to ${url}`);
await cloudTasksClient.createTask({
parent: queueName,
task: {
name: buildTaskName(taskUrl, body, queueName, correlationId, headers?.resendNumber),
httpRequest: {
httpMethod: "POST",
headers: newHeaders,
url,
body: Buffer.from(JSON.stringify(body, null, 2)),
dispatchDeadline: 30 * 60, // 30 minutes
await cloudTasksClient.createTask(
{
parent: queueName,
task: {
name: buildTaskName(taskUrl, body, queueName, correlationId, headers?.resendNumber),
httpRequest: {
httpMethod: "POST",
headers: newHeaders,
url,
body: Buffer.from(JSON.stringify(body, null, 2)),
dispatchDeadline: 30 * 60, // 30 minutes
},
},
},
});
{ retry: { backoffSettings: { maxRetries: 5, initialRetryDelayMillis: 1000, retryDelayMultiplier: 2 } } }
);
}

@@ -76,0 +84,0 @@

{
"name": "@bonniernews/b0rker",
"version": "9.2.2",
"version": "9.3.0",
"engines": {

@@ -30,3 +30,3 @@ "node": ">=18"

"@google-cloud/pubsub": "^4.0.7",
"@google-cloud/tasks": "^5.1.1",
"@google-cloud/tasks": "^5.3.0",
"axios": "^1.6.2",

@@ -33,0 +33,0 @@ "camelcase": "^8.0.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc