Skip to content

Commit

Permalink
Added timeout to NetworkRequests fetching emotes (#20)
Browse files Browse the repository at this point in the history
This should prevent certain emotes from failing to load.
Following the format we sorta established on upstream - 30 seconds for loadEmotes and 20 seconds for loadChannel.
  • Loading branch information
zneix committed Jun 24, 2021
1 parent 6568208 commit c0b1117
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/providers/seventv/SeventvEmotes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ void SeventvEmotes::loadEmotes()
QByteArray b = QByteArray::fromStdString(str.toStdString());

NetworkRequest(apiUrlGQL, NetworkRequestType::Post)
.timeout(30000)
.header("Content-Type", "application/json")
.payload(b)
.onSuccess([this](NetworkResult result) -> Outcome {
Expand Down Expand Up @@ -219,6 +220,7 @@ void SeventvEmotes::loadChannel(std::weak_ptr<Channel> channel,
QByteArray b = QByteArray::fromStdString(str.toStdString());

NetworkRequest(apiUrlGQL, NetworkRequestType::Post)
.timeout(20000)
.header("Content-Type", "application/json")
.payload(b)
.onSuccess([callback = std::move(callback), channel, &channelId,
Expand Down

0 comments on commit c0b1117

Please sign in to comment.