forked from elsa-workflows/elsa-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove triggers that have a malformed path (elsa-workflows#3121)
* create a check to see if the path is valid before creating the watcher. This is so the file system watcher does not try to create directory names that are malformed. * remove test code. * add a way to remove a trigger. Used by the file watcher starter service if the path for the file to watch is invalid. Co-authored-by: Adam S <[email protected]>
- Loading branch information
1 parent
1929a7f
commit 9006904
Showing
4 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
13 changes: 13 additions & 0 deletions
13
src/core/Elsa.Abstractions/Services/Triggers/ITriggerRemover.cs
This file contains 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,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Elsa.Models; | ||
|
||
namespace Elsa.Services | ||
{ | ||
public interface ITriggerRemover | ||
{ | ||
Task RemoveTriggerAsync(Trigger trigger); | ||
} | ||
} |
This file contains 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 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,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Elsa.Models; | ||
using Elsa.Persistence; | ||
|
||
namespace Elsa.Services.Triggers | ||
{ | ||
public class TriggerRemover: ITriggerRemover | ||
{ | ||
private readonly ITriggerStore _triggerStore; | ||
|
||
public TriggerRemover(ITriggerStore triggerStore) | ||
{ | ||
_triggerStore = triggerStore; | ||
} | ||
|
||
public async Task RemoveTriggerAsync(Trigger trigger) | ||
{ | ||
await _triggerStore.DeleteAsync(trigger); | ||
} | ||
} | ||
} |