Skip to content
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
22 changes: 16 additions & 6 deletions src/persistence/BaseMCWSPersistenceProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,25 @@ export default class BaseMCWSPersistenceProvider {
* @returns {Promise.<NamespaceDefinition[]>} persistenceNamespaces
*/
async getPersistenceNamespaces() {
Comment thread
jvigliotta marked this conversation as resolved.
// get root namespaces, get contained namespaces.
if (!this.persistenceNamespaces) {
const rootNamespaces = await this.getRootNamespaces();
const allContainedNamespaces = await this.getAllContainedNamespaces(rootNamespaces);
// Return cached result if available
if (this.persistenceNamespaces) {
return this.persistenceNamespaces;
}

// If initialization is in progress, wait for it
if (!this.persistenceNamespacesPromise) {
this.persistenceNamespacesPromise = (async () => {
const rootNamespaces = await this.getRootNamespaces();
const allContainedNamespaces = await this.getAllContainedNamespaces(rootNamespaces);

this.persistenceNamespaces = [...rootNamespaces, ...allContainedNamespaces];
delete this.persistenceNamespacesPromise;

this.persistenceNamespaces = [...rootNamespaces, ...allContainedNamespaces];
return this.persistenceNamespaces;
})();
}

return this.persistenceNamespaces;
return this.persistenceNamespacesPromise;
}

/**
Expand Down
3 changes: 0 additions & 3 deletions src/services/mcws/MCWSClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ class MCWSClient {
delete options.params;
}

// Keepalive
options.keepalive = true;

try {
response = await fetch(url, options);
} catch (error) {
Expand Down
Loading