Skip to content

Commit

Permalink
Merge pull request #407 from vtex-apps/fix/timeouts
Browse files Browse the repository at this point in the history
Hotfix: add timeout to session and increase to checkout
  • Loading branch information
drawveloper authored Sep 19, 2019
2 parents 0f8a70b + 20a056e commit ac8c86e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const TWO_SECONDS_MS = 2 * 1000
const THREE_SECONDS_MS = 3 * 1000
const SIX_SECONDS_MS = 6 * 1000
const TEN_SECONDS_MS = 10 * 1000
const THIRTY_SECONDS_MS = 30 * 1000

// Segments are small and immutable.
const MAX_SEGMENT_CACHE = 10000
Expand All @@ -28,7 +29,7 @@ export default new Service<Clients, void, CustomContext>({
options: {
checkout: {
concurrency: 10,
timeout: TEN_SECONDS_MS,
timeout: THIRTY_SECONDS_MS,
},
default: {
retries: 2,
Expand All @@ -39,6 +40,10 @@ export default new Service<Clients, void, CustomContext>({
memoryCache: messagesCache,
timeout: TWO_SECONDS_MS,
},
session: {
concurrency: 10,
timeout: TEN_SECONDS_MS,
},
segment: {
concurrency: 10,
memoryCache: segmentCache,
Expand Down
4 changes: 2 additions & 2 deletions node/service.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"stack": "nodejs",
"memory": 1536,
"ttl": 30,
"timeout": 20,
"minReplicas": 10,
"timeout": 40,
"minReplicas": 20,
"maxReplicas": 100
}

0 comments on commit ac8c86e

Please sign in to comment.