Skip to content

Commit

Permalink
Merge pull request #67 from ChevronETC/lessverbosewarning
Browse files Browse the repository at this point in the history
less verbose warning about single threaded behavior on windows
  • Loading branch information
samtkaplan authored Apr 8, 2024
2 parents 84e3661 + fd96c2f commit 3a86925
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/AzStorage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ const API_VERSION = "2021-08-06"
# buffer size for holding OAuth2 tokens
const BUFFER_SIZE = unsafe_load(cglobal((:BUFFER_SIZE, libAzStorage), Int32))

windows_one_thread(nthreads) = Sys.iswindows() ? 1 : nthreads

function __init__()
if Sys.iswindows()
@warn "On Windows, AzStorage is limited to a single thread, meaning that performance may be degraded."
end
@ccall libAzStorage.curl_init(length(RETRYABLE_HTTP_ERRORS)::Cint, length(RETRYABLE_CURL_ERRORS)::Cint, RETRYABLE_HTTP_ERRORS::Ptr{Clong}, RETRYABLE_CURL_ERRORS::Ptr{Clong}, API_VERSION::Cstring)::Cvoid
resetperf_counters()
end
Expand Down Expand Up @@ -112,13 +117,6 @@ Base.close(object::AzObject) = nothing

const __OAUTH_SCOPE = "offline_access+openid+https://storage.azure.com/user_impersonation"

function windows_one_thread(nthreads)
if Sys.iswindows() && nthreads != 1
@warn "On Windows, AzStorage is limited to a single thread."
end
Sys.iswindows() ? 1 : nthreads
end

"""
container = AzContainer("containername"; storageaccount="myacccount", kwargs...)
Expand Down

0 comments on commit 3a86925

Please sign in to comment.