Skip to content

Commit

Permalink
polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
wyang007 committed Jun 8, 2017
1 parent 42efe15 commit 67d67d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion XrdOucName2NamePfn2RucioLfn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ XrdOucName2NameInvRucio::XrdOucName2NameInvRucio(XrdSysError* erp, const char* p
myName = "XrdOucN2N-InvRucio";
cacheDir = "";
eDest = erp;
localMetaLinkRootDir = "/dev/shm";
localMetaLinkRootDir = "/dev/shm/atlas";

x = 0;
key = "";
Expand Down
6 changes: 4 additions & 2 deletions rucioGetMetaLink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ using namespace std;
std::string rucioServerUrl = "https://rucio-lb-prod.cern.ch/redirect/";
std::string rucioServerCgi = "/metalink?schemes=root&select=geoip";

#define MetaLinkLifetime 3600*24

struct rucioMetaLink
{
char *data;
Expand Down Expand Up @@ -107,7 +109,7 @@ std::string makeMetaLink(const std::string pfn)
tmp += " <file name=\"x\">\n";
tmp += " <url location=\"LOCAL\" priority=\"1\">" + myPfn + "</url>\n";
tmp += " </file>\n";
tmp += "</metalink>";
tmp += "</metalink>\n";

fprintf(fd, "%s", tmp.c_str());
fclose(fd);
Expand Down Expand Up @@ -158,7 +160,7 @@ std::string getMetaLink(const std::string DID)
metaLinkFile = metaLinkDir + "/" + file + ".meta4";
time_t t_now = time(NULL);
if (stat(metaLinkFile.c_str(), &statBuf) == 0 &&
(t_now - statBuf.st_mtim.tv_sec) < 3600*24)
(t_now - statBuf.st_mtim.tv_sec) < MetaLinkLifetime)
{
return metaLinkFile;
}
Expand Down

0 comments on commit 67d67d2

Please sign in to comment.