@mblaney/holster 1.0.21 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mblaney/holster",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "Holster is a service that allows synchronising data between devices using Node, Deno, Bun or the browser.",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/src/wire.js CHANGED
@@ -15,7 +15,7 @@ if (typeof globalThis.WebSocket === "undefined") {
15
15
  // Rate limiting with throttling
16
16
  const createRateLimiter = isTestEnv => {
17
17
  const clients = new Map()
18
- const maxRequests = 1000 // requests per minute
18
+ const maxRequests = 1500 // requests per minute
19
19
  const windowMs = 60000 // 1 minute window
20
20
  const disconnectThreshold = 10 // Disconnect after 10 violations
21
21
  let cleanupInterval = null
@@ -654,7 +654,7 @@ const Wire = opt => {
654
654
  // Schedule processing of next message if queue not empty
655
655
  if (messageQueue.length > 0) {
656
656
  // Add delay between messages to respect rate limit
657
- queueProcessor = setTimeout(processQueue, 100)
657
+ queueProcessor = setTimeout(processQueue, 50)
658
658
  } else {
659
659
  queueProcessor = null
660
660
  }
@@ -698,7 +698,7 @@ const Wire = opt => {
698
698
  messageQueue.push(data)
699
699
  // Start queue processor if not already running
700
700
  if (!queueProcessor) {
701
- queueProcessor = setTimeout(processQueue, 100)
701
+ queueProcessor = setTimeout(processQueue, 50)
702
702
  }
703
703
  }
704
704
  if (!(opt.peers instanceof Array)) {