File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ open FsAutoComplete.Logging
99open FSharp.UMX
1010open FsAutoComplete.Utils
1111open Ionide.ProjInfo .ProjectSystem
12+ open IcedTasks
1213
1314let logger = LogProvider.getLoggerByName " FsAutoComplete.Sourcelink"
1415
@@ -217,6 +218,8 @@ let private tryGetUrlForDocument (json: SourceLinkJson) (document: Document) =
217218 else
218219 tryGetUrlWithExactMatch path url document)
219220
221+ let sourceLinkSemaphore = new System.Threading.SemaphoreSlim( 1 , 1 )
222+
220223let private downloadFileToTempDir
221224 ( url : string < Url >)
222225 ( repoPathFragment : string < NormalizedRepoPathSegment >)
@@ -228,7 +231,8 @@ let private downloadFileToTempDir
228231 let tempDir = Path.GetDirectoryName tempFile
229232 Directory.CreateDirectory tempDir |> ignore
230233
231- async {
234+ asyncEx {
235+ use! _ = sourceLinkSemaphore.LockAsync()
232236 // Check if file already exists (cached from previous download)
233237 if File.Exists tempFile then
234238 logger.info (
You can’t perform that action at this time.
0 commit comments