#include "AliShuttleTrigger.h"
#include <TSystem.h>
+#include <TGrid.h>
#include <TObjString.h>
#include "AliLog.h"
if (strlen(fConfig->GetTerminateFilePath()) == 0)
return;
- if (gSystem->AccessPathName(fConfig->GetTerminateFilePath()))
+ if (gSystem->AccessPathName(fConfig->GetTerminateFilePath()) == kFALSE)
{
AliInfo("Terminate file exists. Terminating Shuttle...");
fTerminate = kTRUE;
fMutex.Lock();
while (!(fNotified || fTerminate)) {
- received=fCondition.TimedWaitRelative(1000*fConfig->GetTriggerWait());
- CheckTerminate();
- if (received==1) break; // 1 = timeout
+ for (Int_t iwait = 0; iwait < 10; iwait++){
+ received = fCondition.TimedWaitRelative(1000*fConfig->GetTriggerWait()/10); // to keep the connection to the server alive every minute while waiting for new runs
+ if (received == 1) {
+ if (gGrid) {
+ AliInfo(Form("Keeping the connection to the server alive while waiting for new runs - %d waited from last one", fConfig->GetTriggerWait()/10*iwait));
+ gGrid->Pwd();
+ }
+ else {
+ AliInfo("No gGrid initialized so far, we cannot keep the connection to the server alive while waiting for new runs");
+ }
+ }
+ }
+ //received=fCondition.TimedWaitRelative(1000*fConfig->GetTriggerWait());
+ CheckTerminate();
+ if (received==1) break; // 1 = timeout
}
fNotified = kFALSE;
}
Collect();
+ CheckTerminate();
}
delete notifier;
gSystem->GetFsInfo(fConfig->GetShuttleFileSystem(), &id, &bsize, &blocks, &bfree);
- AliInfo(Form("n. of free blocks = %d, total n. of blocks = %d",bfree,blocks));
+ AliInfo(Form("n. of free blocks = %ld, total n. of blocks = %ld",bfree,blocks));
Int_t spaceFree = (Int_t)(((Float_t)bfree/(Float_t)blocks)*100);
if (spaceFree < fConfig->GetFreeDiskWarningThreshold()) {
to.Remove(to.Length()-1);
AliDebug(2, Form("to: %s",to.Data()));
- // mail body
+ // mail body
TString bodyFileName;
bodyFileName.Form("%s/mail.body", fShuttle->GetShuttleLogDir());
gSystem->ExpandPathName(bodyFileName);