Compare commits
9 Commits
1233156a64
...
master
Author | SHA1 | Date | |
---|---|---|---|
de68cb23dd | |||
c07211706b | |||
f232c612bf | |||
86ebef7b5c | |||
499bc19be5 | |||
e1c57cb63d | |||
dcbbae4603 | |||
954af8537b | |||
eb7ce30da9 |
@ -3,7 +3,6 @@ ARG DEBIAN_FRONTEND=noninteractive
|
||||
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
|
||||
WORKDIR /home/node/app
|
||||
COPY --chown=node:node . .
|
||||
RUN npm install -g npm
|
||||
USER node
|
||||
|
||||
RUN npm install --force
|
||||
|
@ -15,7 +15,8 @@ window.__ = __
|
||||
if(typeof WEB !== 'undefined')
|
||||
{
|
||||
const io = require("socket.io-client");
|
||||
window.torrentSocket = io(document.location.protocol + '//' + document.location.hostname + (process.env.NODE_ENV === 'production' ? '/' : ':8095/'));
|
||||
// window.torrentSocket = io(document.location.protocol + '//' + document.location.hostname + (process.env.NODE_ENV === 'production' ? '/' : ':8095/'));
|
||||
window.torrentSocket = io(document.location.protocol + '//' + document.location.host + '/');
|
||||
const emit = window.torrentSocket.emit.bind(window.torrentSocket);
|
||||
window.torrentSocket.emit = (...data) => {
|
||||
let id;
|
||||
|
@ -285,7 +285,7 @@ module.exports = async ({
|
||||
if(typeof callback != 'function')
|
||||
return;
|
||||
|
||||
if(!text || text.length <= 2) {
|
||||
if(!text || text.length < 2) {
|
||||
callback(undefined);
|
||||
return;
|
||||
}
|
||||
@ -347,7 +347,7 @@ module.exports = async ({
|
||||
{
|
||||
logT('search', 'get torrent via infohash with dht')
|
||||
// 3 try to get torrent from metadata
|
||||
const getTorrentMetadata = (tryCount = 4) => {
|
||||
const getTorrentMetadata = (tryCount = 8) => {
|
||||
if(tryCount <= 0) {
|
||||
logT('search', 'dht NOT found anything with dht', text);
|
||||
return
|
||||
@ -356,7 +356,7 @@ module.exports = async ({
|
||||
dhtCheckTimeout = setTimeout(() => {
|
||||
lock = true
|
||||
getTorrentMetadata(--tryCount)
|
||||
}, 8000);
|
||||
}, 16000);
|
||||
torrentClient.getMetadata(text, (torrent) => {
|
||||
if(lock) {
|
||||
logT('search', 'this dht response not actual for', text);
|
||||
@ -407,7 +407,7 @@ module.exports = async ({
|
||||
if(typeof callback != 'function')
|
||||
return;
|
||||
|
||||
if(!text || text.length <= 2) {
|
||||
if(!text || text.length < 2) {
|
||||
callback(undefined);
|
||||
return;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user