Skip to content
This repository has been archived by the owner on Aug 27, 2018. It is now read-only.

Commit

Permalink
Merge pull request #686 from nono/check_updated
Browse files Browse the repository at this point in the history
Reduce bandwidth when waiting for stack update
  • Loading branch information
Frank Rousseau committed Feb 18, 2016
2 parents 6b13fa2 + 89107b6 commit 6b665d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions client/app/helpers/client.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ exports.request = (type, url, data, callbacks) ->
type: type
url: url
data: data
dataType: 'json'
success: callbacks.success
error: callbacks.error

# Sends a get request with data as body
# Sends a get request
# Expected callbacks: success and error
exports.get = (url, callbacks) ->
exports.request "GET", url, null, callbacks
Expand All @@ -23,7 +24,12 @@ exports.post = (url, data, callbacks) ->
exports.put = (url, data, callbacks) ->
exports.request "PUT", url, data, callbacks

# Sends a delete request with data as body
# Sends a delete request
# Expected callbacks: success and error
exports.del = (url, callbacks) ->
exports.request "DELETE", url, null, callbacks

# Sends a head request
# Expected callbacks: success and error
exports.head = (url, callbacks) ->
exports.request "HEAD", url, null, callbacks
2 changes: 1 addition & 1 deletion client/app/models/stack_application.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = class StackApplication extends Backbone.Model
# The callback is fired only when the servers responds successfully to
# *remainingSteps* requests.
waitServerIsUp: (remainingSteps, callback) ->
request.get "api/applications/stack", (err) =>
request.head "api/applications/stack", (err) =>
if err
console.log 'Server looks down...'
else
Expand Down

0 comments on commit 6b665d2

Please sign in to comment.