Added OCPIPushTokensTask in Scheduler
MODIFY
src/scheduler/SchedulerManager.ts
src/scheduler/SchedulerManager.ts
@@ -21,6 +21,7 @@ import OCPICheckSessionsTask from './tasks/ocpi/OCPICheckSessionsTask';
import OCPIPullCdrsTask from './tasks/ocpi/OCPIPullCdrsTask';
import OCPIPullLocationsTask from './tasks/ocpi/OCPIPullLocationsTask';
import OCPIPullSessionsTask from './tasks/ocpi/OCPIPullSessionsTask';
+import OCPIPushTokensTask from './tasks/ocpi/OCPIPushTokensTask';
import OCPIPullTokensTask from './tasks/ocpi/OCPIPullTokensTask';
import OCPIPushCdrsTask from './tasks/ocpi/OCPIPushCdrsTask';
import OCPIPushEVSEStatusesTask from './tasks/ocpi/OCPIPushEVSEStatusesTask';
@@ -119,6 +120,8 @@ export default class SchedulerManager {
return new OCPIPullTokensTask();
case 'OCPIPushCdrsTask':
return new OCPIPushCdrsTask();
+ case 'OCPIPushTokensTask':
+ return new OCPIPushTokensTask();
case 'SynchronizeRefundTransactionsTask':
return new SynchronizeRefundTransactionsTask();
case 'BillingPeriodicOperationTask':

MODIFY
src/scheduler/tasks/ocpi/OCPIPushTokensTask.ts
src/scheduler/tasks/ocpi/OCPIPushTokensTask.ts
-import { OCPIPullLocationsTaskConfig, TaskConfig } from '../../../types/TaskConfig';
+import { TaskConfig } from '../../../types/TaskConfig';
import Tenant, { TenantComponents } from '../../../types/Tenant';
import Constants from '../../../utils/Constants';
@@ -24,7 +24,7 @@ export default class OCPIPushTokensTask extends TenantSchedulerTask {
// Get all available endpoints
const ocpiEndpoints = await OCPIEndpointStorage.getOcpiEndpoints(tenant, { role: OCPIRole.EMSP }, Constants.DB_PARAMS_MAX_LIMIT);
for (const ocpiEndpoint of ocpiEndpoints.result) {
- await this.processOCPIEndpoint(tenant, ocpiEndpoint, config);
+ await this.processOCPIEndpoint(tenant, ocpiEndpoint);
}
}
} catch (error) {
@@ -33,7 +33,7 @@ export default class OCPIPushTokensTask extends TenantSchedulerTask {
}
}
- private async processOCPIEndpoint(tenant: Tenant, ocpiEndpoint: OCPIEndpoint, config: OCPIPullLocationsTaskConfig): Promise<void> {
+ private async processOCPIEndpoint(tenant: Tenant, ocpiEndpoint: OCPIEndpoint): Promise<void> {
// Get the lock
const ocpiLock = await LockingHelper.createOCPIPushTokensLock(tenant.id, ocpiEndpoint);
if (ocpiLock) {

Added OCPIPushTokensTask in Scheduler