akemon 0.2.9 → 0.2.10
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/dist/task-module.js +10 -0
- package/package.json +1 -1
package/dist/task-module.js
CHANGED
|
@@ -130,6 +130,16 @@ export class TaskModule {
|
|
|
130
130
|
for (const order of orders) {
|
|
131
131
|
if (this.gaveUp.has(order.id))
|
|
132
132
|
continue;
|
|
133
|
+
// Skip orders older than 1 hour — stale orders shouldn't block the agent
|
|
134
|
+
const orderAge = Date.now() - new Date(order.created_at || 0).getTime();
|
|
135
|
+
if (orderAge > 3_600_000) {
|
|
136
|
+
this.gaveUp.add(order.id);
|
|
137
|
+
try {
|
|
138
|
+
await relay.cancelOrder(order.id);
|
|
139
|
+
}
|
|
140
|
+
catch { }
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
133
143
|
const retry = this.orderRetry.get(order.id);
|
|
134
144
|
if (retry && Date.now() < retry.nextAt)
|
|
135
145
|
continue;
|