-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix showing file contents for record item (#2455)
fix #2446 to test: create a schema with a field using files: % schema a % add hello /stdout display bundles in record mode % display record a
- Loading branch information
Showing
3 changed files
with
52 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,22 @@ | ||
import { Semaphore } from 'await-semaphore'; | ||
import $ from 'jquery'; | ||
|
||
// Limit concurrent requests for async resolving items | ||
const MAX_CONCURRENT_REQUESTS = 3; | ||
export const semaphore = new Semaphore(MAX_CONCURRENT_REQUESTS); | ||
|
||
export async function fetchAsyncBundleContents({ contents }) { | ||
// used in table and record items | ||
return semaphore.use(async () => { | ||
const response = await $.ajax({ | ||
type: 'POST', | ||
contentType: 'application/json', | ||
url: '/rest/interpret/genpath-table-contents', | ||
async: true, | ||
data: JSON.stringify({ contents }), | ||
dataType: 'json', | ||
cache: false, | ||
}); | ||
return response; | ||
}); | ||
} |