-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #193 maintenance: move maintenance task management…
… to service maintenance: move maintenance task management to service
- Loading branch information
Showing
29 changed files
with
757 additions
and
768 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,33 @@ | ||
using System; | ||
|
||
namespace Scalar.Common.Maintenance | ||
{ | ||
public static class MaintenanceTasks | ||
{ | ||
public enum Task | ||
{ | ||
Invalid = 0, | ||
FetchCommitsAndTrees, | ||
LooseObjects, | ||
PackFiles, | ||
CommitGraph, | ||
} | ||
|
||
public static string GetVerbTaskName(Task task) | ||
{ | ||
switch (task) | ||
{ | ||
case Task.FetchCommitsAndTrees: | ||
return ScalarConstants.VerbParameters.Maintenance.FetchCommitsAndTreesTaskName; | ||
case Task.LooseObjects: | ||
return ScalarConstants.VerbParameters.Maintenance.LooseObjectsTaskName; | ||
case Task.PackFiles: | ||
return ScalarConstants.VerbParameters.Maintenance.PackFilesTaskName; | ||
case Task.CommitGraph: | ||
return ScalarConstants.VerbParameters.Maintenance.CommitGraphTaskName; | ||
default: | ||
throw new ArgumentException($"Invalid or unknown task {task.ToString()}", nameof(task)); | ||
} | ||
} | ||
} | ||
} |
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
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,7 @@ | ||
namespace Scalar.Service | ||
{ | ||
public interface IRegisteredUserStore | ||
{ | ||
UserAndSession RegisteredUser { get; } | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
using Scalar.Common.Maintenance; | ||
|
||
namespace Scalar.Service | ||
{ | ||
public interface IScalarVerbRunner | ||
{ | ||
bool CallMaintenance(MaintenanceTasks.Task task, string repoRoot, int sessionId); | ||
} | ||
} |
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,8 @@ | ||
namespace Scalar.Service | ||
{ | ||
public interface IServiceTask | ||
{ | ||
void Execute(); | ||
void Stop(); | ||
} | ||
} |
Oops, something went wrong.