summaryrefslogtreecommitdiff
path: root/scripts/memcachedqueuehandler.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-04-23 09:52:21 +0000
committerEvan Prodromou <evan@controlyourself.ca>2009-04-23 09:52:21 +0000
commita3e727823d01ed9fd5f440eeaf27449092309865 (patch)
treeeddec15c74d72305cbd5e7d4f745b8739bc70497 /scripts/memcachedqueuehandler.php
parentece70bf326fa680ec7acdef00751e2bb71bceee1 (diff)
some basic fixes for inbox and memcached queue handlers
Diffstat (limited to 'scripts/memcachedqueuehandler.php')
-rwxr-xr-x[-rw-r--r--]scripts/memcachedqueuehandler.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/scripts/memcachedqueuehandler.php b/scripts/memcachedqueuehandler.php
index 43231fa2c..6e819b41f 100644..100755
--- a/scripts/memcachedqueuehandler.php
+++ b/scripts/memcachedqueuehandler.php
@@ -29,6 +29,7 @@ define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
define('LACONICA', true);
require_once(INSTALLDIR . '/lib/common.php');
+require_once(INSTALLDIR . '/lib/queuehandler.php');
set_error_handler('common_error_handler');
@@ -39,13 +40,22 @@ class MemcachedQueueHandler extends QueueHandler
return 'memcached';
}
+ function start() {
+ $this->log(LOG_INFO, "INITIALIZE");
+ return true;
+ }
+
function handle_notice($notice)
{
// XXX: fork here
- common_log(LOG_INFO, "Blowing memcached for $notice->id");
+ $this->log(LOG_INFO, "Blowing memcached for $notice->id");
$notice->blowCaches();
return true;
}
+
+ function finish() {
+ }
+
}
ini_set("max_execution_time", "0");
@@ -53,6 +63,8 @@ ini_set("max_input_time", "0");
set_time_limit(0);
mb_internal_encoding('UTF-8');
-$handler = new MemcachedQueueHandler($resource);
+$id = ($argc > 1) ? $argv[1] : null;
+
+$handler = new MemcachedQueueHandler($id);
$handler->runOnce();