瀏覽代碼

Improved performance for GET_PLAYLIST job

Kristian Vos 4 年之前
父節點
當前提交
ec506ddcce
共有 1 個文件被更改,包括 0 次插入34 次删除
  1. 0 34
      backend/logic/playlists.js

+ 0 - 34
backend/logic/playlists.js

@@ -712,40 +712,6 @@ class _PlaylistsModule extends CoreClass {
 		return new Promise((resolve, reject) =>
 			async.waterfall(
 				[
-					next => {
-						CacheModule.runJob("HGETALL", { table: "playlists" }, this)
-							.then(playlists => next(null, playlists))
-							.catch(next);
-					},
-
-					(playlists, next) => {
-						if (!playlists) return next();
-
-						const playlistIds = Object.keys(playlists);
-
-						return async.each(
-							playlistIds,
-							(playlistId, next) => {
-								PlaylistsModule.playlistModel.findOne({ _id: playlistId }, (err, playlist) => {
-									if (err) next(err);
-									else if (!playlist) {
-										CacheModule.runJob(
-											"HDEL",
-											{
-												table: "playlists",
-												key: playlistId
-											},
-											this
-										)
-											.then(() => next())
-											.catch(next);
-									} else next();
-								});
-							},
-							next
-						);
-					},
-
 					next => {
 						CacheModule.runJob(
 							"HGET",