P
pantagruel
Hi,
I have the following:
public static void RunBatch() {
if (OnDemandRunning) {
//If OnDemand is Running we will do nothing
}
else{
BatchDirectoryName = "C:\\BatchQ";
String[] BatchDirectory =
Directory.GetFiles(BatchDirectoryName,"*.xml");
for (int counter = 0; counter < BatchDirectory.Length;
counter++) {
///<remarks>
/// need to break if an OnDemand event happens.
///</remarks>
///
//TODO: Implement actual event handling etc. instead of
the fake event handling doing now.
if (OnDemandRunning) { break; }
String BatchFile =
BatchDirectory.GetValue(counter).ToString();
logthis("Batchfile" + BatchFile, 1);
File.Delete(BatchFile);
}
System.Threading.Thread.Sleep(5000);
RunBatch();
}
}
Now I'm not sure if any of the rest of the code is a problem but the
presence of RunBatch(); in RunBatch() is causing it to stall at load.
I've set the Sleep to be really high to avoid any problem like that
but it seems like that does not work. How does one get around that?
I have the following:
public static void RunBatch() {
if (OnDemandRunning) {
//If OnDemand is Running we will do nothing
}
else{
BatchDirectoryName = "C:\\BatchQ";
String[] BatchDirectory =
Directory.GetFiles(BatchDirectoryName,"*.xml");
for (int counter = 0; counter < BatchDirectory.Length;
counter++) {
///<remarks>
/// need to break if an OnDemand event happens.
///</remarks>
///
//TODO: Implement actual event handling etc. instead of
the fake event handling doing now.
if (OnDemandRunning) { break; }
String BatchFile =
BatchDirectory.GetValue(counter).ToString();
logthis("Batchfile" + BatchFile, 1);
File.Delete(BatchFile);
}
System.Threading.Thread.Sleep(5000);
RunBatch();
}
}
Now I'm not sure if any of the rest of the code is a problem but the
presence of RunBatch(); in RunBatch() is causing it to stall at load.
I've set the Sleep to be really high to avoid any problem like that
but it seems like that does not work. How does one get around that?