refactor: Use limit to prevent fetching all records
This commit is contained in:
@@ -91,6 +91,7 @@ class Flow extends Base {
|
||||
async lastInternalId() {
|
||||
const lastExecution = await this.$relatedQuery('executions')
|
||||
.orderBy('created_at', 'desc')
|
||||
.limit(1)
|
||||
.first();
|
||||
|
||||
return lastExecution ? (lastExecution as Execution).internalId : null;
|
||||
|
Reference in New Issue
Block a user