]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - lib/webtorrent.js
Split utils file
[github/Chocobozzz/PeerTube.git] / lib / webtorrent.js
index b72bc500dd93b9871bfa8bb177553cde1d519ecf..d1ca3c9f2fe62a784784416c2c38a8e3a36259ab 100644 (file)
@@ -1,7 +1,7 @@
 ;(function () {
   'use strict'
 
-  module.exports = function (args) {
+  function webtorrent (args) {
     var WebTorrent = require('webtorrent')
     var ipc = require('node-ipc')
 
@@ -62,7 +62,7 @@
       try {
         wt.remove(magnetUri, callback)
       } catch (err) {
-        console.log('Cannot remove the torrent from WebTorrent', { err: err })
+        console.log('Cannot remove the torrent from WebTorrent')
         return callback(null)
       }
 
@@ -88,4 +88,8 @@
       ipc.of[nodeKey].emit(processKey + '.exception', { exception: e })
     })
   }
+
+  // ---------------------------------------------------------------------------
+
+  module.exports = webtorrent
 })()