Skip to content

Commit

Permalink
feat: Enable FusionCache AutoClone (#1550)
Browse files Browse the repository at this point in the history
<!--- Provide a general summary of your changes in the Title above -->

## Description

<!--- Describe your changes in detail -->
Enables
[AutoClone](ZiggyCreatures/FusionCache#279)
feature in FusionCache
## Related Issue(s)

- #1226 

## Verification

- [x] **Your** code builds clean without any errors or warnings
- [x] Manual testing done (required)
- [ ] Relevant automated test added (if you find this hard, leave it and
we'll help out)

## Documentation

- [ ] Documentation is updated (either in `docs`-directory, Altinnpedia
or a separate linked PR in
[altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if
applicable)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Introduced a new property, `EnableAutoClone`, in the caching
configuration to enhance cache management.
- **Bug Fixes**
- Activated the assignment of an empty list to the `SubParties`
property, ensuring no sub-parties are included in the authorized parties
result.
- **Style**
- Minor formatting adjustments made for improved readability in the
caching configuration.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
oskogstad authored Dec 2, 2024
1 parent 8fc34bf commit 714ad5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ void Flatten(AuthorizedParty party, AuthorizedParty? parent = null)

if (parent != null) party.ParentParty = parent.Party;

// TODO: https://github.com/digdir/dialogporten/issues/1533
// Disabling this for now, fixes https://github.com/digdir/dialogporten/issues/1226
// party.SubParties = [];
party.SubParties = [];

flattenedAuthorizedParties.AuthorizedParties.Add(party);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,9 @@ private static IServiceCollection ConfigureFusionCache(this IServiceCollection s
// This will stop deserialization exceptions to be re-thrown, which will cause the factory to run as if
// the cache entry was not found. This avoids crashes which otherwise would happen if entities that
// are cached are changed in a way that makes them incompatible with the cached version.
ReThrowSerializationExceptions = false
ReThrowSerializationExceptions = false,

EnableAutoClone = true
})
.WithRegisteredSerializer()
// If Redis is disabled (eg. in local development or non-web runtimes), we must instruct FusionCache to
Expand Down

0 comments on commit 714ad5c

Please sign in to comment.