Persistency improvements

This commit is contained in:
Paulo Gustavo Veiga 2022-02-18 10:00:26 -08:00
parent 859fcad6a6
commit 9e92b87495

View File

@ -74,7 +74,8 @@ class RESTPersistenceManager extends PersistenceManager {
`${this.documentUrl.replace('{id}', mapId)}?${query}`, `${this.documentUrl.replace('{id}', mapId)}?${query}`,
{ {
method: 'PUT', method: 'PUT',
body: JSON.stringify(data), // Blob helps to resuce the memory on large payload.
body: new Blob([JSON.stringify(data)], { type: 'text/plain' }),
headers: { 'Content-Type': 'application/json; charset=utf-8', Accept: 'application/json' }, headers: { 'Content-Type': 'application/json; charset=utf-8', Accept: 'application/json' },
keepalive: true, keepalive: true,
}, },
@ -131,11 +132,11 @@ class RESTPersistenceManager extends PersistenceManager {
}); });
} }
unlockMap(mapId: string):void { unlockMap(mapId: string): void {
fetch( fetch(
this.lockUrl.replace('{id}', mapId), this.lockUrl.replace('{id}', mapId),
{ {
method: 'POST', method: 'PUT',
headers: { 'Content-Type': 'text/plain' }, headers: { 'Content-Type': 'text/plain' },
body: 'false', body: 'false',
}, },