- take out record watcher

This commit is contained in:
Richard Alam 2014-05-02 14:44:45 +00:00
parent b0d4eea62e
commit 9f4513240e

View File

@ -1,50 +1,9 @@
bunyan = require 'bunyan'
chokidar = require 'chokidar'
Hapi = require 'hapi'
redis = require 'redis'
log = require './lib/logger'
pack = require './package'
routes = require './lib/routes'
client = redis.createClient()
baseKey = 'bbb:recordings:'
#clear the keys first
keys = client.keys(baseKey.concat('*'))
client.del(keys)
#start watching
chokidar.watch('/var/bigbluebutton/published', {ignored: /[\/\\]\./}).on 'all', (event, path)->
somethingChanged(event,path)
chokidar.watch('/var/bigbluebutton/unpublished', {ignored: /[\/\\]\./}).on 'all', (event, path)->
somethingChanged(event,path)
somethingChanged = (event, path) ->
uri = path.split('/')
if uri[5]? #excludes the parent directories being added
#console.log "\nstart" + uri.toString()
meetingID = path.substring(path.lastIndexOf('/')+1).split('-')[0]
timestamp = path.substring(path.lastIndexOf('/')+1).split('-')[1]
thisKey = baseKey.concat(meetingID)
#console.log "thisKey=" + thisKey
json = {
"format": uri[4]
"timestamp": timestamp
}
console.log(event, path)
str = JSON.stringify(json)
client.sadd(thisKey, str)
log = require './lib/logger'
recWatcher = require './lib/recording-dir-watcher'
routes = require './lib/routes'
server = Hapi.createServer("0.0.0.0",
parseInt(process.env.PORT, 10) or 4000)