Other: make GUI Tester more resilient to Bridge abrupt termination.
This commit is contained in:
parent
584ea7e9f8
commit
40cc6b54c9
|
@ -752,7 +752,7 @@ Status GRPCService::ConfigureUserAppleMail(ServerContext *, ConfigureAppleMailRe
|
|||
/// \param[in] writer The writer
|
||||
/// \return The status for the call.
|
||||
//****************************************************************************************************************************************************
|
||||
Status GRPCService::RunEventStream(ServerContext *, EventStreamRequest const *request, ServerWriter<StreamEvent> *writer) {
|
||||
Status GRPCService::RunEventStream(ServerContext *ctx, EventStreamRequest const *request, ServerWriter<StreamEvent> *writer) {
|
||||
app().log().debug(__FUNCTION__);
|
||||
{
|
||||
QMutexLocker locker(&eventStreamMutex_);
|
||||
|
@ -767,19 +767,19 @@ Status GRPCService::RunEventStream(ServerContext *, EventStreamRequest const *re
|
|||
|
||||
while (true) {
|
||||
QMutexLocker locker(&eventStreamMutex_);
|
||||
if (eventStreamShouldStop_) {
|
||||
if (eventStreamShouldStop_ || ctx->IsCancelled()) {
|
||||
qtProxy_.setIsStreaming(false);
|
||||
qtProxy_.setClientPlatform(QString());
|
||||
isStreaming_ = false;
|
||||
return Status::OK;
|
||||
}
|
||||
|
||||
|
||||
if (eventQueue_.isEmpty()) {
|
||||
locker.unlock();
|
||||
QThread::msleep(100);
|
||||
continue;
|
||||
}
|
||||
|
||||
SPStreamEvent const event = eventQueue_.front();
|
||||
eventQueue_.pop_front();
|
||||
locker.unlock();
|
||||
|
|
|
@ -93,7 +93,7 @@ public: // member functions.
|
|||
grpc::Status LogoutUser(::grpc::ServerContext *, ::google::protobuf::StringValue const *request, ::google::protobuf::Empty *) override;
|
||||
grpc::Status RemoveUser(::grpc::ServerContext *, ::google::protobuf::StringValue const *request, ::google::protobuf::Empty *) override;
|
||||
grpc::Status ConfigureUserAppleMail(::grpc::ServerContext *, ::grpc::ConfigureAppleMailRequest const *request, ::google::protobuf::Empty *) override;
|
||||
grpc::Status RunEventStream(::grpc::ServerContext *, ::grpc::EventStreamRequest const *request, ::grpc::ServerWriter<::grpc::StreamEvent> *writer) override;
|
||||
grpc::Status RunEventStream(::grpc::ServerContext *ctx, ::grpc::EventStreamRequest const *request, ::grpc::ServerWriter<::grpc::StreamEvent> *writer) override;
|
||||
grpc::Status StopEventStream(::grpc::ServerContext *, ::google::protobuf::Empty const *, ::google::protobuf::Empty *) override;
|
||||
|
||||
bool sendEvent(bridgepp::SPStreamEvent const &event); ///< Queue an event for sending through the event stream.
|
||||
|
|
Loading…
Reference in New Issue