|
|
@@ -38,6 +38,7 @@ import { BalanceRecord, BalanceType } from '../balance/entities/balance-record.e
|
|
|
import { Device } from '../device/entities/device.entity'
|
|
|
import Decimal from 'decimal.js'
|
|
|
import { CountryConfigService } from '../country-config/country-config.service'
|
|
|
+import { TaskResult } from './types'
|
|
|
import { dashboard } from '../rcs-number/impl/dashboard.service'
|
|
|
import { smspva } from '../rcs-number/impl/smspva.service'
|
|
|
|
|
|
@@ -1396,6 +1397,19 @@ export class TaskService implements OnModuleInit {
|
|
|
if (res.retry?.length > 0) {
|
|
|
await this.updateTaskItemStatus(res.retry, TaskItemStatus.IDLE)
|
|
|
}
|
|
|
+ if (res instanceof Array) {
|
|
|
+ const results = res as TaskResult[]
|
|
|
+ for (let result of results) {
|
|
|
+ this.taskItemRepository.update(
|
|
|
+ { id: result.id },
|
|
|
+ {
|
|
|
+ status: result.sent ? TaskItemStatus.SUCCESS : TaskItemStatus.FAIL,
|
|
|
+ delivery: result.delivery,
|
|
|
+ numberId: result.numberId
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
} catch (e) {
|
|
|
Logger.error('Error running task 3', e.stack, this.TAG)
|
|
|
await this.updateTaskItemStatus(
|