move schedules to their own folder with an index file

merge-requests/208/head
fatchan 5 years ago
parent 85de95bc31
commit 1bb03ea6ff
  1. 8
      ecosystem.config.js
  2. 7
      gulp/res/css/style.css
  3. 14
      schedules/index.js
  4. 12
      views/pages/home.pug

@ -3,7 +3,11 @@ module.exports = {
apps : [{ apps : [{
name: 'build-worker', name: 'build-worker',
script: 'worker.js', script: 'worker.js',
instances: 1, //could increase if building is getting backed up instances: 1,
/*
increase instances if building is getting backed up,
best to keep at numCPUs-1 to prevent server choke under high load though.
*/
autorestart: true, autorestart: true,
watch: false, watch: false,
max_memory_restart: '1G', max_memory_restart: '1G',
@ -32,7 +36,7 @@ module.exports = {
} }
}, { }, {
name: 'schedules', name: 'schedules',
script: 'schedules.js', script: 'schedules/index.js',
instances: 1, instances: 1,
autorestart: true, autorestart: true,
watch: false, watch: false,

@ -82,6 +82,9 @@ pre {
.text-center { .text-center {
text-align: center; text-align: center;
} }
.pr-20 {
padding-right: 20px;
}
.ml-1 { .ml-1 {
margin-left: 1px; margin-left: 1px;
} }
@ -728,13 +731,13 @@ hr + .thread {
table.boardtable td:nth-child(3),table.boardtable td:nth-child(4),table.boardtable td:nth-child(5), table.boardtable td:nth-child(3),table.boardtable td:nth-child(4),table.boardtable td:nth-child(5),
table.boardtable th:nth-child(3),table.boardtable th:nth-child(4),table.boardtable th:nth-child(5) { table.boardtable th:nth-child(3),table.boardtable th:nth-child(4),table.boardtable th:nth-child(5) {
min-width: 90px; min-width: 50px;
} }
@media only screen and (max-width: 600px) { @media only screen and (max-width: 600px) {
table.boardtable td:nth-child(3), table.boardtable th:nth-child(3), table.boardtable td:nth-child(3), table.boardtable th:nth-child(3),
table.boardtable td:nth-child(4), table.boardtable th:nth-child(4) { table.boardtable td:nth-child(5), table.boardtable th:nth-child(5) {
display: none; display: none;
} }

@ -4,9 +4,9 @@ process
.on('uncaughtException', console.error) .on('uncaughtException', console.error)
.on('unhandledRejection', console.error); .on('unhandledRejection', console.error);
const msTime = require(__dirname+'/helpers/mstime.js') const msTime = require(__dirname+'/../helpers/mstime.js')
, Mongo = require(__dirname+'/db/db.js') , Mongo = require(__dirname+'/../db/db.js')
, { enableWebring } = require(__dirname+'/configs/main.json'); , { enableWebring } = require(__dirname+'/../configs/main.json');
(async () => { (async () => {
@ -15,7 +15,7 @@ const msTime = require(__dirname+'/helpers/mstime.js')
console.log('STARTING SCHEDULES'); console.log('STARTING SCHEDULES');
//delete files for expired captchas //delete files for expired captchas
const deleteCaptchas = require(__dirname+'/schedules/deletecaptchas.js'); const deleteCaptchas = require(__dirname+'/deletecaptchas.js');
deleteCaptchas().catch(e => console.error); deleteCaptchas().catch(e => console.error);
setInterval(() => { setInterval(() => {
deleteCaptchas().catch(e => console.error); deleteCaptchas().catch(e => console.error);
@ -23,7 +23,7 @@ const msTime = require(__dirname+'/helpers/mstime.js')
//update webring //update webring
if (enableWebring) { if (enableWebring) {
const updateWebring = require(__dirname+'/schedules/webring.js'); const updateWebring = require(__dirname+'/webring.js');
updateWebring().catch(e => console.error); updateWebring().catch(e => console.error);
setInterval(() => { setInterval(() => {
updateWebring().catch(e => console.error); updateWebring().catch(e => console.error);
@ -31,7 +31,7 @@ const msTime = require(__dirname+'/helpers/mstime.js')
} }
//update board stats and homepage //update board stats and homepage
const taskQueue = require(__dirname+'/queue.js'); const taskQueue = require(__dirname+'/../queue.js');
taskQueue.push({ taskQueue.push({
'task': 'updateStats', 'task': 'updateStats',
'options': {} 'options': {}
@ -42,7 +42,7 @@ const msTime = require(__dirname+'/helpers/mstime.js')
}); });
//file pruning //file pruning
const pruneFiles = require(__dirname+'/schedules/prune.js'); const pruneFiles = require(__dirname+'/prune.js');
pruneFiles().catch(e => console.error); pruneFiles().catch(e => console.error);
setInterval(() => { setInterval(() => {
pruneFiles().catch(e => console.error); pruneFiles().catch(e => console.error);

@ -28,8 +28,8 @@ block content
th Board th Board
th Description th Description
th.help(title='Posts in the last hour') PPH th.help(title='Posts in the last hour') PPH
th.help(title='Unique posters in the last 24h') Active Users th.help(title='Unique posters in the last 24h') Users
th Total Posts th Posts
each board in boards each board in boards
tr tr
td td
@ -45,7 +45,7 @@ block content
tr.help(title='Total stats including unlisted boards') tr.help(title='Total stats including unlisted boards')
th Total Posts th Total Posts
th Total PPH th Total PPH
th Active Users th Total Users
th Active Content th Active Content
tr tr
td #{totalStats.posts} td #{totalStats.posts}
@ -71,8 +71,8 @@ block content
th Board th Board
th Description th Description
th.help(title='Posts in the last hour') PPH th.help(title='Posts in the last hour') PPH
th.help(title='Unique posters in the last 24h') Active Users th.help(title='Unique posters in the last 24h') Users
th Total Posts th.pr-20 Posts
each board in webringBoards each board in webringBoards
tr tr
td td
@ -82,6 +82,6 @@ block content
td #{board.subtitle || '-'} td #{board.subtitle || '-'}
td #{board.postsPerHour || '-'} td #{board.postsPerHour || '-'}
td #{board.uniqueUsers || '-'} td #{board.uniqueUsers || '-'}
td #{board.totalPosts || '-'} td.pr-20 #{board.totalPosts || '-'}
p p
small: a(href='https://gitlab.com/alogware/LynxChanAddon-Webring') webring? small: a(href='https://gitlab.com/alogware/LynxChanAddon-Webring') webring?

Loading…
Cancel
Save