Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

Commit

Permalink
increase remote fs calls timeout to 1 hour
Browse files Browse the repository at this point in the history
  • Loading branch information
greyarch committed Aug 31, 2017
1 parent 71d997d commit 3f8e497
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docker-dashboard-agent-compose",
"version": "3.4.3",
"version": "3.4.4",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions src/coffee/storage.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ module.exports = (agent, mqtt, config) ->
targetpath = path.join '/', config.domain, name
lockFile = path.join basePath, ".#{name}.delete.lock"
fs.writeFile lockFile, "Deleting #{targetpath}...", ->
console.log "Deleting #{targetpath}..."
lib.remoteFs config.remotefsUrl, 'rm', {dir: targetpath}, ->
console.log "#{targetpath} was successfully deleted"
fs.unlink lockFile, callback

agent.on '/storage/create', (params, {name, source}, callback) ->
Expand All @@ -35,7 +37,9 @@ module.exports = (agent, mqtt, config) ->
targetpath = path.join '/', config.domain, name
lockFile = path.join basePath, ".#{name}.copy.lock"
fs.writeFile lockFile, "Copying #{srcpath} to #{targetpath}...", ->
console.log "Copying #{srcpath} to #{targetpath}..."
lib.remoteFs config.remotefsUrl, 'cp', {source: srcpath, destination: targetpath}, ->
console.log "#{srcpath} was successfully copied to #{targetpath}"
fs.unlink lockFile, callback
else
targetpath = path.join basePath, name
Expand Down
1 change: 1 addition & 0 deletions src/coffee/storage/lib.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module.exports =
url: "#{remoteFsUrl}/fs/#{cmd}"
method: 'POST'
json: payload
timeout: 3600000 # timeout in an hour
, (err, res, body) ->
console.error err if err
cb err, body
Expand Down
1 change: 1 addition & 0 deletions tests/coffee/storage/lib.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ describe 'Storage/Lib', ->
td.when(request({
url: 'remoteFsUrl/fs/some-cmd'
method: 'POST'
timeout: 3600000
json: 'payload'}
)).thenCallback null, null, 'mydata'
lib.remoteFs 'remoteFsUrl', 'some-cmd', 'payload', cb
Expand Down

0 comments on commit 3f8e497

Please sign in to comment.