Make controller Async
This PR has a large blast radius because it takes the final step and bumps up the Controller to be fully async. We have historically done a piece-by-piece update, so all operations were already async but the controller interface was kept synchronous. With this update, the controller is now fully async and all tests are updated. Most places where the new C# compiler warns about function names not ending in `Async` were also adressed, giving a massive refactor change. Functionally, no changes are done.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
using System.Threading.Tasks;
|
||||
using Duplicati.Library.Crashlog;
|
||||
|
||||
namespace Duplicati.CommandLine.DatabaseTool.Net10
|
||||
@@ -25,7 +26,7 @@ namespace Duplicati.CommandLine.DatabaseTool.Net10
|
||||
// Wrapper class to keep code independent
|
||||
public static class Program
|
||||
{
|
||||
public static int Main(string[] args)
|
||||
=> CrashlogHelper.WrapWithCrashLog(() => DatabaseTool.Program.Main(args).ConfigureAwait(false).GetAwaiter().GetResult());
|
||||
public static Task<int> Main(string[] args)
|
||||
=> CrashlogHelper.WrapWithCrashLog(() => DatabaseTool.Program.MainAsync(args));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user