fix: queue time calculation
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

pull/115/head 1.2.4-alpha.2
shancheas 2024-11-15 11:16:29 +07:00
parent 72827aa83e
commit ec916ab574
1 changed files with 5 additions and 1 deletions

View File

@ -41,10 +41,14 @@ export class QueueDataService extends BaseReadService<QueueModel> {
const queues = await this.repo.find({
where: {
item_queue_id,
status: 'waiting',
},
});
for (const queue of queues) {
queueTimes[queues[0].id] = now; // first queue will be now
for (let i = 1; i < queues.length; i++) {
const queue = queues[i];
// duration will be total qty multiple by average
const duration = queue.qty * average;