Skip to content

Commit

Permalink
added retry block
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemann16 committed Oct 3, 2018
1 parent 190bb81 commit f38cb10
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
8 changes: 4 additions & 4 deletions plugins/i3s/io/EsriReader.cpp
Expand Up @@ -363,9 +363,9 @@ void EsriReader::traverseTree(Json::Value page, int index,
if ((firstChild + i) > (firstNode + m_nodeCap - 1))
{
pageIndex = (Version("2.0") < m_version) ||
(Version("2.0") == m_version ?
(Version("2.0") == m_version) ?
(firstChild + i) / m_nodeCap :
((firstChild + i) / m_nodeCap) * m_nodeCap);
((firstChild + i) / m_nodeCap) * m_nodeCap;

if (m_nodepages.find(pageIndex) != m_nodepages.end())
page = m_nodepages[pageIndex];
Expand All @@ -378,9 +378,9 @@ void EsriReader::traverseTree(Json::Value page, int index,
}
if (pageIndex != 0)
index = (Version("2.0") < m_version) ||
(Version("2.0") == m_version ?
(Version("2.0") == m_version) ?
(firstChild + i) % (m_nodeCap * pageIndex):
(firstChild + i) % (pageIndex));
(firstChild + i) % (pageIndex);
else
index = firstChild + i;
traverseTree(page, index, nodes, depth, pageIndex);
Expand Down
17 changes: 16 additions & 1 deletion plugins/i3s/io/I3SReader.cpp
Expand Up @@ -34,6 +34,7 @@

#include "I3SReader.hpp"
#include "EsriUtil.hpp"
#include <thread>

namespace pdal
{
Expand Down Expand Up @@ -81,7 +82,21 @@ std::vector<char> I3SReader::fetchBinary(std::string url,
std::string attNum, std::string ext) const
{
// For the REST I3S endpoint there are no file extensions.
return m_arbiter->getBinary(url + attNum);
std::vector<char> returnVec;
for (int i = 0; i < 5; ++i)
{
try
{
returnVec = m_arbiter->getBinary(url + attNum);
continue;
}
catch(std::exception& e)
{
std::cout << "Node: " << attNum << " \ni: "<< i << std::endl;
std::this_thread::sleep_for(std::chrono::milliseconds(250));
}
}
return returnVec;
}

} //namespace pdal

0 comments on commit f38cb10

Please sign in to comment.