@clonegod/ttd-core 2.1.13 → 2.1.14

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.
@@ -1 +1 @@
1
- export declare function appendLogWithPeriodicReset(dir: string, filename: string, line: string, hours: number): Promise<void>;
1
+ export declare function appendLogWithPeriodicReset(dir: string, filename: string, line: string, minutes?: number): Promise<void>;
@@ -12,11 +12,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.appendLogWithPeriodicReset = appendLogWithPeriodicReset;
13
13
  const fs_1 = require("fs");
14
14
  let lastResetAtMap = {};
15
- function appendLogWithPeriodicReset(dir, filename, line, hours) {
16
- return __awaiter(this, void 0, void 0, function* () {
15
+ function appendLogWithPeriodicReset(dir_1, filename_1, line_1) {
16
+ return __awaiter(this, arguments, void 0, function* (dir, filename, line, minutes = 30) {
17
17
  var _a;
18
18
  const now = Date.now();
19
- const intervalMs = hours * 60 * 60 * 1000;
19
+ const safeMinutes = Math.max(1, Math.floor(minutes));
20
+ const intervalMs = safeMinutes * 60 * 1000;
20
21
  if (!(0, fs_1.existsSync)(dir)) {
21
22
  (0, fs_1.mkdirSync)(dir, { recursive: true });
22
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-core",
3
- "version": "2.1.13",
3
+ "version": "2.1.14",
4
4
  "description": "Common types and utilities for trading systems - use `npm run push` to publish",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",