views:

60

answers:

1

Using RequestAdditionalTime for a windows service, does not prolong the waiting period long enough. I have to wait for a job to finish , so i keep on

            while (gs_bisProcessing)
            {
                OnRequestMoreTime(20000);
                Thread.Sleep(20000);
            }

but still the job takes long enough that the service while stopping, gives the message box that the service did not respond in a timely fashion... and teh state of the service stays 'Stopping' even if you refresh. So what to do now? I want to do the same thing onShutdown too? Any ideas?

+1  A: 

Did you mean RequestAdditionalTime(ms)?

I'd probably check prior to 20 seconds elapsing, that seems to be about the magic number. I wouldn't sleep that long, but probably be checking your flag every 10-15 seconds instead.

Joe