Browse Source

Merge pull request #131 from dandevaud/feature/Add-Gather-Missing-data-only

Add Gather all Missing data to market data overview
pull/5027/head
dandevaud 8 months ago
committed by GitHub
parent
commit
d435835947
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 17
      apps/api/src/app/admin/admin.controller.ts
  2. 11
      apps/client/src/app/components/admin-market-data/admin-market-data.component.ts
  3. 3
      apps/client/src/app/components/admin-market-data/admin-market-data.html
  4. 4
      apps/client/src/app/services/admin.service.ts

17
apps/api/src/app/admin/admin.controller.ts

@ -105,6 +105,23 @@ export class AdminController {
this.dataGatheringService.gatherMax(); this.dataGatheringService.gatherMax();
} }
@HasPermission(permissions.accessAdminControl)
@Post('gather/missing')
@UseGuards(AuthGuard('jwt'), HasPermissionGuard)
public async gatherMissing(): Promise<void> {
const assetProfileIdentifiers =
await this.dataGatheringService.getAllAssetProfileIdentifiers();
const promises = assetProfileIdentifiers.map(({ dataSource, symbol }) => {
return this.dataGatheringService.gatherSymbolMissingOnly({
dataSource,
symbol
});
});
await Promise.all(promises);
}
@HasPermission(permissions.accessAdminControl) @HasPermission(permissions.accessAdminControl)
@Post('gather/profile-data') @Post('gather/profile-data')
@UseGuards(AuthGuard('jwt'), HasPermissionGuard) @UseGuards(AuthGuard('jwt'), HasPermissionGuard)

11
apps/client/src/app/components/admin-market-data/admin-market-data.component.ts

@ -260,6 +260,17 @@ export class AdminMarketDataComponent
}); });
} }
public onGatherMissing() {
this.adminService
.gatherMissingOnly()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => {
setTimeout(() => {
window.location.reload();
}, 300);
});
}
public onGatherProfileData() { public onGatherProfileData() {
this.adminService this.adminService
.gatherProfileData() .gatherProfileData()

3
apps/client/src/app/components/admin-market-data/admin-market-data.html

@ -194,6 +194,9 @@
<button mat-menu-item (click)="onGatherMax()"> <button mat-menu-item (click)="onGatherMax()">
<ng-container i18n>Gather All Data</ng-container> <ng-container i18n>Gather All Data</ng-container>
</button> </button>
<button mat-menu-item (click)="onGatherMissing()">
<ng-container i18n>Gather All Missing Data</ng-container>
</button>
<button mat-menu-item (click)="onGatherProfileData()"> <button mat-menu-item (click)="onGatherProfileData()">
<ng-container i18n>Gather Profile Data</ng-container> <ng-container i18n>Gather Profile Data</ng-container>
</button> </button>

4
apps/client/src/app/services/admin.service.ts

@ -168,6 +168,10 @@ export class AdminService {
return this.http.post<void>('/api/v1/admin/gather/max', {}); return this.http.post<void>('/api/v1/admin/gather/max', {});
} }
public gatherMissingOnly() {
return this.http.post<void>('/api/v1/admin/gather/missing', {});
}
public gatherProfileData() { public gatherProfileData() {
return this.http.post<void>('/api/v1/admin/gather/profile-data', {}); return this.http.post<void>('/api/v1/admin/gather/profile-data', {});
} }

Loading…
Cancel
Save