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

fix export #5270

Merged
merged 4 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#pragma once

#include "azure/core/dll_import_export.hpp"
#include "azure/data/tables/dll_import_export.hpp"

#include <azure/core/http/policies/policy.hpp>

Expand All @@ -12,11 +12,11 @@

namespace Azure { namespace Data { namespace Tables { namespace _detail { namespace Policies {

AZ_CORE_DLLEXPORT extern const Azure::Core::Context::Key SecondaryHostReplicaStatusKey;
AZ_DATA_TABLES_DLLEXPORT extern const Azure::Core::Context::Key SecondaryHostReplicaStatus;

inline Azure::Core::Context WithReplicaStatus(const Azure::Core::Context& context)
{
return context.WithValue(SecondaryHostReplicaStatusKey, std::make_shared<bool>(true));
return context.WithValue(SecondaryHostReplicaStatus, std::make_shared<bool>(true));
}

class SwitchToSecondaryPolicy final : public Azure::Core::Http::Policies::HttpPolicy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

namespace Azure { namespace Data { namespace Tables { namespace _detail { namespace Policies {

Azure::Core::Context::Key const SecondaryHostReplicaStatusKey;
Azure::Core::Context::Key const SecondaryHostReplicaStatus;

std::unique_ptr<Azure::Core::Http::RawResponse> SwitchToSecondaryPolicy::Send(
Azure::Core::Http::Request& request,
Azure::Core::Http::Policies::NextHttpPolicy nextPolicy,
const Azure::Core::Context& context) const
{
std::shared_ptr<bool> replicaStatus;
context.TryGetValue(SecondaryHostReplicaStatusKey, replicaStatus);
context.TryGetValue(SecondaryHostReplicaStatus, replicaStatus);

bool considerSecondary = (request.GetMethod() == Azure::Core::Http::HttpMethod::Get
|| request.GetMethod() == Azure::Core::Http::HttpMethod::Head)
Expand Down
Loading