Skip to content

Stop() function doesn't work. #104

Description

@RFBomb

per this thread:
https://stackoverflow.com/questions/56349033/robocopy-rh-run-end-time-parameter

The RunHours parameter is used to define a set time frame to run within. For example, only run between 2pm and 4pm.
I'm a bit confused as to why this restriction made it into the API.

as in, why use:

if (process != null && CopyOptions.RunHours.IsNullOrWhiteSpace() && !hasExited)

instead of

if (process != null && !hasExited)

Obviously I can do a workaround in the code by supplying it with a DateTime.Now() and format the string accordingly, but that seems obtuse.

The secondary question here, is if RoboCommand.Dispose() is called, that should end the process, correct?
this is how it is in the code:

if (process != null)
     process.Dispose();

Note that process.kill() is missing.
I tried using RoboCommand.Dispose(), and it just kept running (even updating my progress bar).


Current Code for RoboCommand.Stop()

public void Stop()
{
   if (process != null && CopyOptions.RunHours.IsNullOrWhiteSpace() && !hasExited)   
   {
      process.Kill();
      hasExited = true;
      process.Dispose();
      process = null;
      isCancelled = true;
      isRunning = false;
   }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions