Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to async methods and remove RabbitMQ #567

Merged
merged 7 commits into from
Feb 7, 2025
Merged

Conversation

KrzysztofPajak
Copy link
Member

Refactored various services and controllers to use asynchronous methods for improved performance and responsiveness. Removed MassTransit and MassTransit.RabbitMQ packages and related RabbitMQ configuration and code. Updated appsettings.json to remove RabbitMQ settings and enable Grand.Module.Api feature. Modified tests to align with asynchronous changes.

Refactored various services and controllers to use asynchronous methods for improved performance and responsiveness. Removed `MassTransit` and `MassTransit.RabbitMQ` packages and related RabbitMQ configuration and code. Updated `appsettings.json` to remove RabbitMQ settings and enable `Grand.Module.Api` feature. Modified tests to align with asynchronous changes.
Modified GeneratedThumbExists in AmazonPictureService to be async.
Changed method signature to async Task<bool>.
Replaced synchronous GetObjectAsync call with await.
Simplified return statements for better readability.
Updated catch block to return false directly.
Improves performance and adheres to modern async practices.
- Removed `clearCache` parameter from `InsertSetting`, `UpdateSetting`, and `SetSetting` methods in `SettingService` class; cache is now always cleared.
- Updated `ISettingService` interface to reflect the removal of `clearCache` parameter.
- Fixed syntax error in `AmazonPictureService` by removing an extra closing parenthesis.
- Removed `_disposed` field from `MemoryCacheBase`.
- Improved readability in `ShippingFixedRateController` by removing an unnecessary line break in `SetSetting` method call.
- Updated `PaymentServiceTests` to match the new `SetSetting` method signature without the `clearCache` parameter.
Refactored `LoadSetting` methods in `SettingService` and `ISettingService` to be synchronous. Updated `ICacheBase` and `MemoryCacheBase` to include and implement synchronous `Get` methods. Removed unused `using` directive from `ServiceCollectionExtensions.cs` and updated it to use the synchronous `LoadSetting` method.
@KrzysztofPajak KrzysztofPajak merged commit 462db62 into main Feb 7, 2025
5 checks passed
@KrzysztofPajak KrzysztofPajak deleted the refactor/cache branch February 7, 2025 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant