Format session window changes
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m50s
Foundation / checks (checks) (push) Failing after 11m2s
Foundation / checks (network) (push) Successful in 9m30s
Foundation / checks (client) (push) Successful in 12m18s
Foundation / checks (tsan) (push) Successful in 7m36s
Foundation / checks (postgres) (push) Failing after 23m9s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m50s
Foundation / checks (checks) (push) Failing after 11m2s
Foundation / checks (network) (push) Successful in 9m30s
Foundation / checks (client) (push) Successful in 12m18s
Foundation / checks (tsan) (push) Successful in 7m36s
Foundation / checks (postgres) (push) Failing after 23m9s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped
This commit is contained in:
@@ -18,12 +18,13 @@ class SessionWindow {
|
||||
static constexpr std::uint64_t max_duration_seconds = 30 * 60;
|
||||
|
||||
static std::expected<SessionWindow, Error> open(std::string_view specification,
|
||||
std::uint64_t now_seconds) {
|
||||
std::uint64_t now_seconds) {
|
||||
const auto colon = specification.rfind(':');
|
||||
if (colon == std::string_view::npos || colon == 0 || colon + 1 == specification.size())
|
||||
return std::unexpected(Error::malformed);
|
||||
const auto id = specification.substr(0, colon);
|
||||
if (id.find_first_not_of("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz._-") !=
|
||||
if (id.find_first_not_of(
|
||||
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz._-") !=
|
||||
std::string_view::npos)
|
||||
return std::unexpected(Error::malformed);
|
||||
std::uint64_t deadline{};
|
||||
@@ -45,10 +46,18 @@ class SessionWindow {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
[[nodiscard]] bool closed() const noexcept { return closed_; }
|
||||
[[nodiscard]] std::uint64_t deadline_seconds() const noexcept { return deadline_seconds_; }
|
||||
[[nodiscard]] const std::string& activation_id() const noexcept { return activation_id_; }
|
||||
void close() noexcept { closed_ = true; }
|
||||
[[nodiscard]] bool closed() const noexcept {
|
||||
return closed_;
|
||||
}
|
||||
[[nodiscard]] std::uint64_t deadline_seconds() const noexcept {
|
||||
return deadline_seconds_;
|
||||
}
|
||||
[[nodiscard]] const std::string& activation_id() const noexcept {
|
||||
return activation_id_;
|
||||
}
|
||||
void close() noexcept {
|
||||
closed_ = true;
|
||||
}
|
||||
|
||||
private:
|
||||
SessionWindow(std::string activation_id, std::uint64_t deadline_seconds)
|
||||
|
||||
Reference in New Issue
Block a user