Hi,
I have the following:
public static void RunBatch() {
if (OnDemandRunnin g) {
//If OnDemand is Running we will do nothing
}
else{
BatchDirectoryN ame = "C:\\BatchQ ";
String[] BatchDirectory =
Directory.GetFi les(BatchDirect oryName,"*.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 (OnDemandRunnin g) { break; }
String BatchFile =
BatchDirectory. GetValue(counte r).ToString();
logthis("Batchf ile" + BatchFile, 1);
File.Delete(Bat chFile);
}
System.Threadin g.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 (OnDemandRunnin g) {
//If OnDemand is Running we will do nothing
}
else{
BatchDirectoryN ame = "C:\\BatchQ ";
String[] BatchDirectory =
Directory.GetFi les(BatchDirect oryName,"*.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 (OnDemandRunnin g) { break; }
String BatchFile =
BatchDirectory. GetValue(counte r).ToString();
logthis("Batchf ile" + BatchFile, 1);
File.Delete(Bat chFile);
}
System.Threadin g.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?
Comment