summaryrefslogtreecommitdiff
path: root/src/node/hooks/express/adminplugins.js
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2013-03-25 12:45:23 +0100
committerMarcel Klehr <mklehr@gmx.net>2013-03-25 12:45:23 +0100
commit0070eab4164ef473c706fe7f1f5c8064e7c819b9 (patch)
tree37117c8c36734ed74f51570920921bb8b8036694 /src/node/hooks/express/adminplugins.js
parentef7fb5c7f0e233268530eb8cd6eb02224751dae5 (diff)
downloadetherpad-lite-0070eab4164ef473c706fe7f1f5c8064e7c819b9.zip
Fix caching of npm search results and only make one registry request on /admin/plugins
fixes #1488
Diffstat (limited to 'src/node/hooks/express/adminplugins.js')
-rw-r--r--src/node/hooks/express/adminplugins.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node/hooks/express/adminplugins.js b/src/node/hooks/express/adminplugins.js
index 7e221cf1..85bf2108 100644
--- a/src/node/hooks/express/adminplugins.js
+++ b/src/node/hooks/express/adminplugins.js
@@ -36,7 +36,7 @@ exports.socketio = function (hook_name, args, cb) {
socket.on("checkUpdates", function() {
socket.emit("progress", {progress:0, message:'Checking for plugin updates...'});
// Check plugins for updates
- installer.search({offset: 0, pattern: '', limit: 500}, /*useCache:*/true, function(data) { // hacky
+ installer.search({offset: 0, pattern: '', limit: 500}, /*maxCacheAge:*/60*10, function(data) { // hacky
if (!data.results) return;
var updatable = _(plugins.plugins).keys().filter(function(plugin) {
if(!data.results[plugin]) return false;
@@ -51,7 +51,7 @@ exports.socketio = function (hook_name, args, cb) {
socket.on("search", function (query) {
socket.emit("progress", {progress:0, message:'Fetching results...'});
- installer.search(query, true, function (progress) {
+ installer.search(query, /*maxCacheAge:*/60*10, function (progress) {
if (progress.results)
socket.emit("search-result", progress);
socket.emit("progress", progress);