From dffe7ffe4e6089aaa6a7cb31b419c326aa2af187 Mon Sep 17 00:00:00 2001 From: cKey <35512826+colinin@users.noreply.github.com> Date: Thu, 6 Apr 2023 11:56:33 +0800 Subject: [PATCH] Fixed the retry mechanism in webhooks and tasks modules --- .../api/webhooks/model/subscriptionsModel.ts | 6 +- apps/vue/src/api/webhooks/send-attempts.ts | 26 ++- apps/vue/src/api/webhooks/subscriptions.ts | 12 ++ .../Table/src/components/AdvancedSearch.vue | 25 ++- .../Table/src/types/advancedSearch.ts | 10 ++ apps/vue/src/hooks/abp/useDefineSettings.ts | 65 ++++++++ apps/vue/src/store/modules/settings.ts | 55 +++++++ apps/vue/src/utils/http/axios/checkStatus.ts | 4 +- .../components/SendAttemptModal.vue | 7 +- .../components/SendAttemptTable.vue | 102 ++++++++++-- .../webhooks/send-attempts/datas/ModalData.ts | 28 ++-- .../components/SubscriptionModal.vue | 12 +- .../components/SubscriptionTable.vue | 54 ++++++- .../webhooks/subscriptions/datas/ModalData.ts | 22 +-- .../webhooks/subscriptions/datas/TableData.ts | 7 + apps/vue/types/abp.d.ts | 2 +- .../ElasticsearchAuditLogManager.cs | 2 - .../EntityFrameworkCore/AuditLogManager.cs | 2 - .../LINGYUN/Abp/AuditLogging/AuditLog.cs | 1 - .../LINGYUN/Abp/AuditLogging/AuditingStore.cs | 2 - .../Queryable/Dto/DynamicParamterDto.cs | 2 + .../Queryable/Dto/ParamterOptionDto.cs | 6 + .../Queryable/DynamicQueryableAppService.cs | 67 +++++++- ...sManagementPermissionDefinitionProvider.cs | 2 +- .../Abp/BackgroundTasks/JobEventBase.cs | 4 + .../LINGYUN/Abp/BackgroundTasks/JobInfo.cs | 27 ++-- .../README.md | 2 + .../EventBus/DistributedJobDispatcher.cs | 55 +++++++ .../Quartz/QuartzJobCreator.cs | 3 +- .../BackgroundTasks/BackgroundJobManager.cs | 2 +- .../BackgroundWorkerManager.cs | 12 +- .../Abp/BackgroundTasks/IJobDispatcher.cs | 35 ++++ .../Abp/BackgroundTasks/IJobPublisher.cs | 7 +- .../Abp/BackgroundTasks/IJobScheduler.cs | 2 +- .../Internal/BackgroundPollingJob.cs | 30 +++- .../Internal/JobExecutedEvent.cs | 152 ++++++++++-------- .../Localization/Resources/en.json | 21 ++- .../Localization/Resources/zh-Hans.json | 21 ++- .../Abp/BackgroundTasks/NullJobDispatcher.cs | 26 +++ .../LINGYUN.Abp.BackgroundTasks/README.md | 10 ++ .../Abp/Webhooks/AbpWebhooksOptions.cs | 15 +- .../Abp/Webhooks/DefaultWebhookSender.cs | 18 ++- .../WebhookSendRecordGetListInput.cs | 2 + .../WebhookSubscriptionExtensions.cs | 8 +- .../WebhookSendRecordAppService.cs | 51 +++--- .../WebhookSubscriptionAppService.cs | 93 +++++++---- .../Localization/Resources/en.json | 5 +- .../Localization/Resources/zh-Hans.json | 5 +- .../IWebhookSubscriptionRepository.cs | 5 +- .../EfCoreWebhookSubscriptionRepository.cs | 27 +--- ...ksManagementHttpApiHostModule.Configure.cs | 4 + 51 files changed, 915 insertions(+), 248 deletions(-) create mode 100644 apps/vue/src/hooks/abp/useDefineSettings.ts create mode 100644 apps/vue/src/store/modules/settings.ts create mode 100644 aspnet-core/modules/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN/Abp/Dynamic/Queryable/Dto/ParamterOptionDto.cs create mode 100644 aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/LINGYUN/Abp/BackgroundTasks/EventBus/DistributedJobDispatcher.cs create mode 100644 aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/IJobDispatcher.cs create mode 100644 aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/NullJobDispatcher.cs diff --git a/apps/vue/src/api/webhooks/model/subscriptionsModel.ts b/apps/vue/src/api/webhooks/model/subscriptionsModel.ts index 5b9590429..52d81ee9f 100644 --- a/apps/vue/src/api/webhooks/model/subscriptionsModel.ts +++ b/apps/vue/src/api/webhooks/model/subscriptionsModel.ts @@ -1,6 +1,7 @@ -export interface WebhookSubscription extends CreationAuditedEntityDto { +export interface WebhookSubscription extends CreationAuditedEntityDto, IHasConcurrencyStamp { tenantId?: string; webhookUri: string; + description?: string; secret: string; isActive: boolean; webhooks: string[]; @@ -9,6 +10,7 @@ export interface WebhookSubscription extends CreationAuditedEntityDto { export interface WebhookSubscriptionCreateOrUpdate { webhookUri: string; + description?: string; secret: string; isActive: boolean; webhooks: string[]; @@ -17,7 +19,7 @@ export interface WebhookSubscriptionCreateOrUpdate { export type CreateWebhookSubscription = WebhookSubscriptionCreateOrUpdate; -export type UpdateWebhookSubscription = WebhookSubscriptionCreateOrUpdate; +export interface UpdateWebhookSubscription extends WebhookSubscriptionCreateOrUpdate , IHasConcurrencyStamp {}; export interface WebhookAvailable { name: string; diff --git a/apps/vue/src/api/webhooks/send-attempts.ts b/apps/vue/src/api/webhooks/send-attempts.ts index 7afcc4518..72d2a837c 100644 --- a/apps/vue/src/api/webhooks/send-attempts.ts +++ b/apps/vue/src/api/webhooks/send-attempts.ts @@ -26,6 +26,18 @@ export const deleteById = (id: string) => { }); } +export const deleteMany = (keys: string[]) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'DeleteManyAsync', + uniqueName: 'DeleteManyAsyncByInput', + data: { + recordIds: keys, + }, + }); +} + export const getList = (input: WebhookSendAttemptGetListInput) => { return defAbpHttp.request>({ service: remoteServiceName, @@ -46,4 +58,16 @@ export const resend = (id: string) => { id: id, }, }); -} \ No newline at end of file +} + +export const resendMany = (keys: string[]) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'ResendManyAsync', + uniqueName: 'ResendManyAsyncByInput', + data: { + recordIds: keys, + }, + }); +} diff --git a/apps/vue/src/api/webhooks/subscriptions.ts b/apps/vue/src/api/webhooks/subscriptions.ts index 3bc6ffe94..64a31a03e 100644 --- a/apps/vue/src/api/webhooks/subscriptions.ts +++ b/apps/vue/src/api/webhooks/subscriptions.ts @@ -53,6 +53,18 @@ export const deleteById = (id: string) => { }); }; +export const deleteMany = (keys: string[]) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'DeleteManyAsync', + uniqueName: 'DeleteManyAsyncByInput', + data: { + recordIds: keys, + }, + }); +}; + export const getList = (input: WebhookSubscriptionGetListInput) => { return defAbpHttp.request>({ service: remoteServiceName, diff --git a/apps/vue/src/components/Table/src/components/AdvancedSearch.vue b/apps/vue/src/components/Table/src/components/AdvancedSearch.vue index ee557e871..6a481f80a 100644 --- a/apps/vue/src/components/Table/src/components/AdvancedSearch.vue +++ b/apps/vue/src/components/Table/src/components/AdvancedSearch.vue @@ -39,7 +39,17 @@