Skip to content

Commit

Permalink
Commit resilient dashboard here.
Browse files Browse the repository at this point in the history
  • Loading branch information
KADichev authored and KADichev committed Nov 15, 2018
1 parent 3a1ef3f commit 498909a
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/dashboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,20 +452,15 @@ namespace allscale { namespace dashboard

auto start = std::chrono::steady_clock::now();

auto f = client.get_system_state().then(
[&client, start](hpx::future<std::vector<node_state>> nodes)
auto f = client.get_system_state();
f.then(
[&client](hpx::future<std::vector<node_state>> nodes)
{
system_state state;

auto next_update =
[start]()
{
using namespace std::chrono_literals;
auto duration = std::chrono::steady_clock::now() - start;
if (duration < 1s)
std::this_thread::sleep_for(1s - duration);
update();
};
[]()
{};

try
{
Expand Down Expand Up @@ -512,6 +507,12 @@ namespace allscale { namespace dashboard
next_update();
}
});

using namespace std::chrono_literals;
auto duration = std::chrono::steady_clock::now() - start;
if (duration < 1s)
std::this_thread::sleep_for(1s - duration);
hpx::apply(update);
}

void get_commands()
Expand Down

0 comments on commit 498909a

Please sign in to comment.