Exemple #1
0
    public JctTest Execute(JctRestartViaSmsAttempt jctMessageType)
    {
        // after five minutes, publish an event to check if the JCT logged in
        var jctLoggedInTimeOut = TimeSpan.FromMinutes(double.Parse(_appSettings["JctLogInTimeOut"]));
        var message            = new JctRestartViaSmsValidate(jctMessageType.Imei);

        Thread.Wait(jctLoggedInTimeOut.Milliseconds);

        _queues.Publish(message);

        // reset test values
        return(new JctTest("6", jctMessageType.Imei, null, null, null));
    }
Exemple #2
0
    public async Task <JctTest> Execute(JctRestartViaSmsAttempt jctMessageType)
    {
        // after five minutes, publish an event to check if the JCT logged in
        var jctLoggedInTimeOut = TimeSpan.FromMinutes(double.Parse(_appSettings["JctLogInTimeOut"]));
        var message            = new JctRestartViaSmsValidate(jctMessageType.Imei);

        // this will now delay in a non blocking fashion.
        await Task.Delay(jctLoggedInTimeOut)
        .ContinueWith(x => _queues.Publish(message));

        // reset test values
        return(new JctTest("6", jctMessageType.Imei, null, null, null));
    }