Преглед на файлове

Merge pull request #2613 from overleaf/spd-tags-timeout

Use a longer timeout when talking to the tags API

GitOrigin-RevId: 467f981c1818293c28dd288d7223540597a8ca3e
nate stemen преди 6 години
родител
ревизия
ab5101f189
променени са 2 файла, в които са добавени 10 реда и са изтрити 10 реда
  1. 1 1
      services/web/app/src/Features/Tags/TagsHandler.js
  2. 9 9
      services/web/test/unit/src/Tags/TagsHandlerTests.js

+ 1 - 1
services/web/app/src/Features/Tags/TagsHandler.js

@@ -17,7 +17,7 @@ const request = require('request')
 const logger = require('logger-sharelatex')
 const logger = require('logger-sharelatex')
 const { promisifyAll } = require('../../util/promises')
 const { promisifyAll } = require('../../util/promises')
 
 
-const TIMEOUT = 1000
+const TIMEOUT = 10000
 const TagsHandler = {
 const TagsHandler = {
   getAllTags(user_id, callback) {
   getAllTags(user_id, callback) {
     this._requestTags(user_id, (err, allTags) => {
     this._requestTags(user_id, (err, allTags) => {

+ 9 - 9
services/web/test/unit/src/Tags/TagsHandlerTests.js

@@ -59,7 +59,7 @@ describe('TagsHandler', function() {
         this.request.del
         this.request.del
           .calledWith({
           .calledWith({
             url: `${tagsUrl}/user/${user_id}/project/${project_id}`,
             url: `${tagsUrl}/user/${user_id}/project/${project_id}`,
-            timeout: 1000
+            timeout: 10000
           })
           })
           .should.equal(true)
           .should.equal(true)
         return done()
         return done()
@@ -136,7 +136,7 @@ describe('TagsHandler', function() {
         const getOpts = {
         const getOpts = {
           url: `${tagsUrl}/user/${user_id}/tag`,
           url: `${tagsUrl}/user/${user_id}/tag`,
           json: true,
           json: true,
-          timeout: 1000
+          timeout: 10000
         }
         }
         this.request.get.calledWith(getOpts).should.equal(true)
         this.request.get.calledWith(getOpts).should.equal(true)
         return done()
         return done()
@@ -174,7 +174,7 @@ describe('TagsHandler', function() {
           json: {
           json: {
             name: this.name
             name: this.name
           },
           },
-          timeout: 1000
+          timeout: 10000
         })
         })
         .should.equal(true)
         .should.equal(true)
     })
     })
@@ -197,7 +197,7 @@ describe('TagsHandler', function() {
         return this.request.del
         return this.request.del
           .calledWith({
           .calledWith({
             url: `${tagsUrl}/user/${user_id}/tag/${tag_id}`,
             url: `${tagsUrl}/user/${user_id}/tag/${tag_id}`,
-            timeout: 1000
+            timeout: 10000
           })
           })
           .should.equal(true)
           .should.equal(true)
       })
       })
@@ -244,7 +244,7 @@ describe('TagsHandler', function() {
             json: {
             json: {
               name: this.name
               name: this.name
             },
             },
-            timeout: 1000
+            timeout: 10000
           })
           })
           .should.equal(true)
           .should.equal(true)
       })
       })
@@ -288,7 +288,7 @@ describe('TagsHandler', function() {
         return this.request.del
         return this.request.del
           .calledWith({
           .calledWith({
             url: `${tagsUrl}/user/${user_id}/tag/${tag_id}/project/${project_id}`,
             url: `${tagsUrl}/user/${user_id}/tag/${tag_id}/project/${project_id}`,
-            timeout: 1000
+            timeout: 10000
           })
           })
           .should.equal(true)
           .should.equal(true)
       })
       })
@@ -337,7 +337,7 @@ describe('TagsHandler', function() {
         return this.request.post
         return this.request.post
           .calledWith({
           .calledWith({
             url: `${tagsUrl}/user/${user_id}/tag/${tag_id}/project/${project_id}`,
             url: `${tagsUrl}/user/${user_id}/tag/${tag_id}/project/${project_id}`,
-            timeout: 1000
+            timeout: 10000
           })
           })
           .should.equal(true)
           .should.equal(true)
       })
       })
@@ -389,7 +389,7 @@ describe('TagsHandler', function() {
               name: tag
               name: tag
             },
             },
             url: `${tagsUrl}/user/${user_id}/tag/project/${project_id}`,
             url: `${tagsUrl}/user/${user_id}/tag/project/${project_id}`,
-            timeout: 1000
+            timeout: 10000
           })
           })
           .should.equal(true)
           .should.equal(true)
       })
       })
@@ -440,7 +440,7 @@ describe('TagsHandler', function() {
               user_id: 'new-user-id'
               user_id: 'new-user-id'
             },
             },
             url: `${tagsUrl}/user/old-user-id/tag`,
             url: `${tagsUrl}/user/old-user-id/tag`,
-            timeout: 1000
+            timeout: 10000
           })
           })
           .should.equal(true)
           .should.equal(true)
       })
       })