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

serum-vial

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serum-vial - npm Package Compare versions

Comparing version 1.4.3 to 1.4.4

2

dist/boot_server.js

@@ -22,3 +22,3 @@ "use strict";

const minionWorker = new worker_threads_1.Worker(path_1.default.resolve(__dirname, 'minion.js'), {
workerData: { nodeEndpoint, port, markets }
workerData: { nodeEndpoint, port, markets, minionNumber: i }
});

@@ -25,0 +25,0 @@ minionWorker.on('error', (err) => {

@@ -354,6 +354,19 @@ "use strict";

}
const { port, nodeEndpoint, markets } = worker_threads_1.workerData;
const { port, nodeEndpoint, markets, minionNumber } = worker_threads_1.workerData;
const minion = new Minion(nodeEndpoint, markets);
let lastPublishTimestamp = new Date();
if (minionNumber === 0) {
setInterval(() => {
const noDataPublishedForSeconds = (new Date().valueOf() - lastPublishTimestamp.valueOf()) / 1000;
if (noDataPublishedForSeconds > 30) {
logger_1.logger.log('info', `No market data published for prolonged time`, {
lastPublishTimestamp: lastPublishTimestamp.toISOString(),
noDataPublishedForSeconds
});
}
}, 15 * 1000).unref();
}
minion.start(port).then(() => {
helpers_1.serumDataChannel.onmessage = (message) => {
lastPublishTimestamp = new Date();
minion.processMessages(message.data);

@@ -360,0 +373,0 @@ };

@@ -46,2 +46,17 @@ "use strict";

});
let start = process.hrtime();
const interval = 600;
// based on https://github.com/tj/node-blocked/blob/master/index.js
setInterval(() => {
const delta = process.hrtime(start);
const nanosec = delta[0] * 1e9 + delta[1];
const ms = nanosec / 1e6;
const n = ms - interval;
if (n > 200) {
logger_1.logger.log('info', `Event loop blocked for ${Math.round(n)} ms.`, {
market: this._options.marketName
});
}
start = process.hrtime();
}, interval).unref();
for await (const notification of rpcClient.streamAccountsNotification(market, this._options.marketName)) {

@@ -48,0 +63,0 @@ if (started === false) {

{
"name": "serum-vial",
"version": "1.4.3",
"version": "1.4.4",
"engines": {

@@ -5,0 +5,0 @@ "node": ">=15"

@@ -31,3 +31,3 @@ import os from 'os'

const minionWorker = new Worker(path.resolve(__dirname, 'minion.js'), {
workerData: { nodeEndpoint, port, markets }
workerData: { nodeEndpoint, port, markets, minionNumber: i }
})

@@ -34,0 +34,0 @@

@@ -433,8 +433,29 @@ import { getLayoutVersion, Market } from '@project-serum/serum'

const { port, nodeEndpoint, markets } = workerData as { port: number; nodeEndpoint: string; markets: SerumMarket[] }
const { port, nodeEndpoint, markets, minionNumber } = workerData as {
port: number
nodeEndpoint: string
markets: SerumMarket[]
minionNumber: number
}
const minion = new Minion(nodeEndpoint, markets)
let lastPublishTimestamp = new Date()
if (minionNumber === 0) {
setInterval(() => {
const noDataPublishedForSeconds = (new Date().valueOf() - lastPublishTimestamp.valueOf()) / 1000
if (noDataPublishedForSeconds > 30) {
logger.log('info', `No market data published for prolonged time`, {
lastPublishTimestamp: lastPublishTimestamp.toISOString(),
noDataPublishedForSeconds
})
}
}, 15 * 1000).unref()
}
minion.start(port).then(() => {
serumDataChannel.onmessage = (message) => {
lastPublishTimestamp = new Date()
minion.processMessages(message.data)

@@ -441,0 +462,0 @@ }

@@ -67,2 +67,21 @@ import { Market } from '@project-serum/serum'

let start = process.hrtime()
const interval = 600
// based on https://github.com/tj/node-blocked/blob/master/index.js
setInterval(() => {
const delta = process.hrtime(start)
const nanosec = delta[0] * 1e9 + delta[1]
const ms = nanosec / 1e6
const n = ms - interval
if (n > 200) {
logger.log('info', `Event loop blocked for ${Math.round(n)} ms.`, {
market: this._options.marketName
})
}
start = process.hrtime()
}, interval).unref()
for await (const notification of rpcClient.streamAccountsNotification(market, this._options.marketName)) {

@@ -69,0 +88,0 @@ if (started === false) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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