File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed
Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ async function getPopularUploads(){
2424
2525 if ( logCaching == 'true' ) {
2626 c . l ( 'Beginning caching popular uploads, getting popular uploads from db' ) ;
27+ console . log ( moment ( new Date ) . format ( 'hh:mm:ss A' ) )
2728 }
2829
2930 // TODO: have to have a job to update upload's view amounts
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ const _ = require('lodash');
33const View = require ( '../models/index' ) . View ;
44const Upload = require ( '../models/index' ) . Upload ;
55const categories = require ( '../config/categories' ) ;
6+ const moment = require ( 'moment' ) ;
67
78const javascriptTimeAgo = require ( 'javascript-time-ago' ) ;
89javascriptTimeAgo . locale ( require ( 'javascript-time-ago/locales/en' ) ) ;
@@ -23,6 +24,7 @@ async function getRecentUploads(){
2324
2425 if ( logCaching == 'true' ) {
2526 console . log ( `Beginning running recent uploads` ) ;
27+
2628 }
2729
2830 let recentUploadsAllCategories = [ ] ;
@@ -65,6 +67,9 @@ async function getRecentUploads(){
6567async function setRecentUploads ( ) {
6668 let recentUploads = await getRecentUploads ( ) ;
6769
70+ console . log ( `Calculating view amounts` ) ;
71+ console . log ( moment ( new Date ) . format ( 'hh:mm:ss A' ) )
72+
6873 // calculate view periods for each upload
6974 recentUploads = await Promise . all ( recentUploads . map ( async function ( upload ) {
7075
Original file line number Diff line number Diff line change @@ -110,14 +110,14 @@ console.log(`CACHE TOTAL VIEW INTERVAL IN MINUTES: ${cacheIntervalInMinutes} \n`
110110
111111async function main ( ) {
112112
113- setInterval ( cacheOnlyRecentUploads , cacheRecentIntervalInMs ) ;
114-
115- setInterval ( cachePopularDailyStatsAndIndex , cacheIntervalInMs ) ;
116-
117- // calculate total amount of views for channel display
118- // TODO: couldn't this just be done during popular? maybe not because it doesn't do for sensitive?
119- // TODO: then just do a separate job for
120- setInterval ( calculateUploadViews , cacheTotalViewsIntervalInMs ) ;
113+ // setInterval(cacheOnlyRecentUploads, cacheRecentIntervalInMs);
114+ //
115+ // setInterval(cachePopularDailyStatsAndIndex, cacheIntervalInMs);
116+ //
117+ // // calculate total amount of views for channel display
118+ // // TODO: couldn't this just be done during popular? maybe not because it doesn't do for sensitive?
119+ // // TODO: then just do a separate job for
120+ // setInterval(calculateUploadViews, cacheTotalViewsIntervalInMs);
121121
122122 // calculate and cache recent uploads every minute
123123 await cacheOnlyRecentUploads ( ) ;
You can’t perform that action at this time.
0 commit comments