Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

send fake unavailable on exit

  • Loading branch information...
commit 844194c66eab98fbe3225330ede4438005b52267 1 parent 680660d
@jedahan jedahan authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/faker.coffee
View
12 src/faker.coffee
@@ -68,5 +68,17 @@ fakeData = (swarm) ->
, 5000
req.write '\n'
+
+process.on 'SIGTERM', ->
+ process.exit 1
+
+process.on 'SIGINT', ->
+ process.exit 1
+
+process.on 'exit', ->
+ console.log 'sending presence "unavailable"'
+ req.write JSON.stringify { presence: { type: "unavailable" } }
+
+
fakeData()
app.listen 33
Please sign in to comment.
Something went wrong with that request. Please try again.