mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-24 18:56:32 -05:00
19 lines
No EOL
562 B
JavaScript
19 lines
No EOL
562 B
JavaScript
// core
|
|
var logger = require("../logger.js");
|
|
var models = require("../models");
|
|
|
|
process.on('message', function (data) {
|
|
if (!data || !data.msg || data.msg !== 'save note revision') return process.exit();
|
|
models.Revision.saveAllNotesRevision(function (err, notes) {
|
|
if (err) {
|
|
logger.error('note revision saver failed: ' + err);
|
|
return process.exit();
|
|
}
|
|
if (notes && notes.length <= 0) {
|
|
process.send({
|
|
msg: 'empty'
|
|
});
|
|
}
|
|
process.exit();
|
|
});
|
|
}); |