mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-11 02:30:21 +08:00
[cloud-api] DONT Timeout streaming API connections every 15 minutes anymore
This is a temporary commit to prevent connections from being closed
while we release logic to re-establish delta connections after they are closed.
Our infrastructure should be able to support current usage of delta
connections after our fixes to offline notification and infrastructure
This reverts commit 78f67d4a76
.
This commit is contained in:
parent
18bf86769d
commit
95766e990a
1 changed files with 1 additions and 4 deletions
|
@ -1,8 +1,6 @@
|
|||
const _ = require('underscore');
|
||||
const Rx = require('rx-lite')
|
||||
const stream = require('stream');
|
||||
const DELTA_CONNECTION_TIMEOUT_MS = 15 * 60000;
|
||||
const OBSERVABLE_TIMEOUT_MS = DELTA_CONNECTION_TIMEOUT_MS - (1 * 60000);
|
||||
|
||||
/**
|
||||
* A Transaction references objects that changed. This finds and inflates
|
||||
|
@ -63,7 +61,6 @@ function transactionsSinceCursor(db, cursor, accountId) {
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
DELTA_CONNECTION_TIMEOUT_MS: DELTA_CONNECTION_TIMEOUT_MS,
|
||||
buildAPIStream(request, {databasePromise, cursor, accountId, deltasSource}) {
|
||||
return databasePromise.then((db) => {
|
||||
const source = Rx.Observable.merge(
|
||||
|
@ -72,7 +69,7 @@ module.exports = {
|
|||
deltasSource.flatMap((t) =>
|
||||
stringifyTransactions(db, accountId, [t], "new")),
|
||||
Rx.Observable.interval(1000).map(() => "\n")
|
||||
).timeout(OBSERVABLE_TIMEOUT_MS);
|
||||
)
|
||||
|
||||
const outputStream = stream.Readable();
|
||||
outputStream._read = () => { return };
|
||||
|
|
Loading…
Reference in a new issue