@jsreport/jsreport-core 4.8.0 → 4.9.0

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.
@@ -396,9 +396,11 @@ class MainReporter extends Reporter {
396
396
  }
397
397
 
398
398
  worker = await this._workersManager.allocate(req, {
399
- timeout: this.getReportTimeout(req)
399
+ timeout: req.context.reportTimeoutCountAfterWorkerAllocated ? 0 : this.getReportTimeout(req)
400
400
  })
401
401
 
402
+ req.context.workerAllocatedTimestamp = new Date().getTime()
403
+
402
404
  if (options.abortEmitter) {
403
405
  options.abortEmitter.once('abort', () => {
404
406
  if (workerAborted) {
@@ -61,7 +61,9 @@ class Reporter extends EventEmitter {
61
61
  * @public Ensures that we get the proper report timeout in case when custom timeout per request was enabled
62
62
  */
63
63
  getReportTimeout (req) {
64
- const elapsedTime = req.context.startTimestamp ? (new Date().getTime() - req.context.startTimestamp) : 0
64
+ const startTimestamp = req.context.reportTimeoutCountAfterWorkerAllocated ? req.context.workerAllocatedTimestamp : req.context.startTimestamp
65
+
66
+ const elapsedTime = startTimestamp ? (new Date().getTime() - startTimestamp) : 0
65
67
  if (
66
68
  this.options.enableRequestReportTimeout &&
67
69
  req.options != null &&
@@ -61,6 +61,7 @@ class WorkerReporter extends Reporter {
61
61
  this.addRequestContextMetaConfig('id', { sandboxReadOnly: true })
62
62
  this.addRequestContextMetaConfig('reportCounter', { sandboxReadOnly: true })
63
63
  this.addRequestContextMetaConfig('startTimestamp', { sandboxReadOnly: true })
64
+ this.addRequestContextMetaConfig('workerAllocatedTimestamp', { sandboxReadOnly: true })
64
65
  this.addRequestContextMetaConfig('logs', { sandboxReadOnly: true })
65
66
  this.addRequestContextMetaConfig('isChildRequest', { sandboxReadOnly: true })
66
67
  this.addRequestContextMetaConfig('originalInputDataIsEmpty', { sandboxReadOnly: true })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsreport/jsreport-core",
3
- "version": "4.8.0",
3
+ "version": "4.9.0",
4
4
  "description": "javascript based business reporting",
5
5
  "keywords": [
6
6
  "report",
@@ -52,7 +52,7 @@
52
52
  "debug": "4.3.2",
53
53
  "decamelize": "2.0.0",
54
54
  "deepmerge": "2.1.0",
55
- "diff": "3.5.0",
55
+ "diff": "4.0.4",
56
56
  "diff-match-patch": "1.0.5",
57
57
  "enhanced-resolve": "5.8.3",
58
58
  "has-own-deep": "1.1.0",
@@ -79,7 +79,7 @@
79
79
  "devDependencies": {
80
80
  "@node-rs/jsonwebtoken": "0.2.0",
81
81
  "jsdom": "24.1.0",
82
- "mocha": "10.1.0",
82
+ "mocha": "11.7.5",
83
83
  "should": "13.2.3",
84
84
  "standard": "16.0.4",
85
85
  "std-mocks": "1.0.1",