-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp.js
More file actions
32 lines (26 loc) · 871 Bytes
/
Copy pathapp.js
File metadata and controls
32 lines (26 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* jslint node: true */
"use strict";
var FB_URL = require('./config').FB_URL;
var Firebase = require('firebase');
var os = require('os');
var spawn = require('child_process').spawn;
var schedule = require('node-schedule');
var tvguide = require('./tvguide');
var myRootRef = new Firebase(FB_URL);
var dvr = require('./dvr');
dvr.start(); // is a "start" even necessary?
/*
// Do something when app is closing
process.on('exit', dvr.cleanup());
process.stdin.resume(); //so the program will not close instantly
//catches ctrl+c event
process.on('SIGINT', dvr.cleanup());
//catches uncaught exceptions
// Here's where I'm torn. I need to call dvr.cleanup as well, not sure if this will work
// if I add it.
//process.on('uncaughtException', dvr.cleanup_error(err));
process.on('uncaughtException', function(err) {
console.error(err.stack);
dvr.cleanup();
});
*/