Example #1
0
        public Task ReceiveAsync(IContext context)
        {
            switch (context.Message)
            {
            case Started _:
                _logger.Warning($"Worker {context.Self} restarting...");
                context.Send(context.Self !, new StartCracking());
                break;

            case Stopping _:
                _logger.Error($"Worker {context.Self} stopping...");
                break;

            case Stopped _:
                _logger.Error($"Worker {context.Self} stopped");
                break;

            case Restarting _:
                _logger.Warning($"Worker {context.Self} restarting...");
                break;

            case StartCracking _:
                StartCrack(context);
                break;

            case RequestNumKeysTried _:
                context.Send(context.Parent !, new ResponseNumKeysTried(NumKeysTried));
                break;
            }
            return(Task.CompletedTask);
        }
Example #2
0
        public async Task DeleteUserByPrincipalNameAsync(string userPrincipalName, bool throwException = true)
        {
            if (throwException)
            {
                await GraphClient.Users[userPrincipalName].Request().DeleteAsync();
            }

            try
            {
                await GraphClient.Users[userPrincipalName].Request().DeleteAsync();
            }
            catch (Exception e)
            {
                _log.Warning(e.Message);
            }
        }