@dudousxd/nestjs-durable-store-typeorm 0.20.0 → 0.20.1

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/index.cjs CHANGED
@@ -1146,12 +1146,20 @@ var TypeOrmStateStore = class {
1146
1146
  });
1147
1147
  return rows.map(fromRunEntity);
1148
1148
  }
1149
- async listDueTimers(nowMs, namespace) {
1150
- const rows = await this.runs().findBy({
1151
- status: "suspended",
1152
- wakeAt: (0, import_typeorm2.LessThanOrEqual)(new Date(nowMs)),
1153
- ...namespace !== void 0 ? {
1154
- namespace
1149
+ async listDueTimers(nowMs, namespace, limit) {
1150
+ const rows = await this.runs().find({
1151
+ where: {
1152
+ status: "suspended",
1153
+ wakeAt: (0, import_typeorm2.LessThanOrEqual)(new Date(nowMs)),
1154
+ ...namespace !== void 0 ? {
1155
+ namespace
1156
+ } : {}
1157
+ },
1158
+ order: {
1159
+ wakeAt: "ASC"
1160
+ },
1161
+ ...limit !== void 0 ? {
1162
+ take: limit
1155
1163
  } : {}
1156
1164
  });
1157
1165
  return rows.map(fromRunEntity);