Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added cloud_status check before sending message #460

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,8 +939,8 @@ static void close_conn ( noPollConn *conn, bool is_shutting_down)
void close_and_unref_connection(noPollConn *conn, bool is_shutting_down)
{
if (conn) {
close_conn (conn, is_shutting_down);
set_cloud_status(CLOUD_STATUS_OFFLINE);
close_conn (conn, is_shutting_down);
ParodusInfo("cloud_status set as %s after connection close\n", get_cloud_status());
int chk_ret = remove("/tmp/webpanotifyready");
if(chk_ret == 0)
Expand Down
10 changes: 9 additions & 1 deletion src/upstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,15 @@ int sendUpstreamMsgToServer(void **resp_bytes, size_t resp_size)
//TODO: Upstream and downstream messages in queue should be handled and queue should be empty before parodus forcefully disconnect from cloud.
if(!close_retry || (get_parodus_cfg()->cloud_disconnect !=NULL))
{
sendRetStatus = sendMessage(get_global_conn(),appendData, encodedSize);
if(strcmp(get_parodus_cfg()->cloud_status,CLOUD_STATUS_ONLINE) == 0)
{
sendRetStatus = sendMessage(get_global_conn(),appendData, encodedSize);
}
else
{
ParodusError("cloud_status is offline, unable to send metadata pack to server\n");
sendRetStatus = 1;
}
}
else
{
Expand Down
Loading