Skip to content

Commit

Permalink
CI: fix "Too Many Requests"
Browse files Browse the repository at this point in the history
  • Loading branch information
Smertig committed May 5, 2024
1 parent 5560fb0 commit 90a3c31
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/examples_util.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#pragma once

#include <chrono>
#include <iostream>
#include <string>
#include <utility>
#include <thread>
#include <tuple>
#include <utility>

inline std::tuple<std::string, std::string, std::string, std::string> parse_input_or_fail(int argc, const char** argv) {
auto token = argc > 1 ? argv[1] : std::getenv("BANANA_BOT_TOKEN");
Expand Down Expand Up @@ -31,5 +33,8 @@ inline std::tuple<std::string, std::string, std::string, std::string> parse_inpu
}
message_text += "!";

// Hack to make sure each example has 1 second delay before calling telegram API
std::this_thread::sleep_for(std::chrono::seconds(1));

return { token, target, std::move(example_name), std::move(message_text) };
}

0 comments on commit 90a3c31

Please sign in to comment.