-
Notifications
You must be signed in to change notification settings - Fork 0
ESB-827: added deferred versioning operations #79
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1dd112a
ESB-827: deferred versioning operations
MEM2677 2454591
ESB-827: added deferred versioning operations
MEM2677 e28ccd1
ESB-827: fix version gitops cache version
MEM2677 005af37
ESB-827: fix conflict
MEM2677 7083ee6
ESB-827: fix version gitops cache version
MEM2677 1f421bc
ESB-827: Updated POM with JACMS version
MEM2677 21646a2
ESB-827: quality gate
MEM2677 7a78a49
ESB-827: quality gate
MEM2677 d7f0a1a
ESB-827 fixed corner case
MEM2677 68d7ba8
ESB-827: test coverage
MEM2677 79d3689
ESB-827: test coverage
MEM2677 8747447
ESB-827: test coverage
MEM2677 536590b
ESB-827: code cleaning
MEM2677 57ca944
ESB-827: code cleaning
MEM2677 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...om/agiletec/plugins/jpversioning/aps/system/services/versioning/IFDeferredVersioning.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| package com.agiletec.plugins.jpversioning.aps.system.services.versioning; | ||
|
|
||
| import com.agiletec.aps.system.ApsSystemUtils.ApsDeepDebug; | ||
| import java.util.concurrent.CompletableFuture; | ||
| import java.util.concurrent.Executor; | ||
| import java.util.function.Supplier; | ||
| import org.entando.entando.aps.system.services.IFeatureFlag; | ||
|
|
||
| public interface IFDeferredVersioning extends IFeatureFlag { | ||
| boolean DEFERRED_VERSIONING_ENABLED = checkEnabled(); | ||
|
|
||
| default boolean isEnabled() { | ||
| return DEFERRED_VERSIONING_ENABLED; | ||
| } | ||
|
|
||
| static boolean checkEnabled() { | ||
| return IFeatureFlag.readEnablementStatus("DEFERRED_VERSIONING"); | ||
| } | ||
|
|
||
| static CompletableFuture<Void> possiblyDeferred(Executor executor, Supplier<String> action, String method) { | ||
| if (checkEnabled()) { | ||
| ApsDeepDebug.print("deferred-versioning", "running versioning task in a separate thread: " + method); | ||
|
|
||
| return CompletableFuture.runAsync(() -> action.get(), executor); | ||
| } else { | ||
| try { | ||
| action.get(); | ||
| return CompletableFuture.completedFuture(null); | ||
| } catch (Exception e) { | ||
| CompletableFuture<Void> failed = new CompletableFuture<>(); | ||
| failed.completeExceptionally(e); | ||
| return failed; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Questo non l'ho capito
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Risolto, in effetti non c'era nessuno a raccogliere l'eccezione asincrona