rads-db 3.0.77 → 3.0.78

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.
@@ -146,6 +146,11 @@ var _default = options => (schema, entity) => {
146
146
  console.warn(`Db overloaded. Retrying after ${delay}ms...`);
147
147
  await new Promise(resolve => setTimeout(resolve, delay));
148
148
  }
149
+ if (chunkToSend.length !== 0) {
150
+ throw new _cosmos.RestError("Db oveloaded. Too many retries. Consider increasing database RU setting.", {
151
+ code: "429"
152
+ });
153
+ }
149
154
  ctx?.log?.({
150
155
  charge: _lodash.default.sumBy(responses, r => r.requestCharge),
151
156
  request: `put#${chunk[0]._partition}[${chunk.length}]`
@@ -1,4 +1,4 @@
1
- import { CosmosClient } from "@azure/cosmos";
1
+ import { CosmosClient, RestError } from "@azure/cosmos";
2
2
  import _ from "lodash";
3
3
  const cosmosClientCache = {};
4
4
  const databaseClientCache = {};
@@ -103,6 +103,11 @@ export default (options) => (schema, entity) => {
103
103
  console.warn(`Db overloaded. Retrying after ${delay}ms...`);
104
104
  await new Promise((resolve) => setTimeout(resolve, delay));
105
105
  }
106
+ if (chunkToSend.length !== 0) {
107
+ throw new RestError("Db oveloaded. Too many retries. Consider increasing database RU setting.", {
108
+ code: "429"
109
+ });
110
+ }
106
111
  ctx?.log?.({
107
112
  charge: _.sumBy(responses, (r) => r.requestCharge),
108
113
  request: `put#${chunk[0]._partition}[${chunk.length}]`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rads-db",
3
- "version": "3.0.77",
3
+ "version": "3.0.78",
4
4
  "packageManager": "pnpm@8.6.1",
5
5
  "description": "Say goodbye to boilerplate code and hello to efficient and elegant syntax.",
6
6
  "author": "",