diff options
author | friendica <info@friendica.com> | 2013-09-30 18:33:27 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-09-30 18:33:27 -0700 |
commit | e992cfeca9a80583b7cde12776fcfe279be02996 (patch) | |
tree | 8e36d5f0a350fa5f1fae4c931c4a4028c5ac62a7 /install/update.php | |
parent | e0391de90674e759a73d08517641e6207606493f (diff) | |
download | volse-hubzilla-e992cfeca9a80583b7cde12776fcfe279be02996.tar.gz volse-hubzilla-e992cfeca9a80583b7cde12776fcfe279be02996.tar.bz2 volse-hubzilla-e992cfeca9a80583b7cde12776fcfe279be02996.zip |
directory sync - this will either work, or it won't work, or it will possibly recurse and blow up the matrix. Hard to say. Do you feel lucky? Well do ya' ... punk? Rule #1 - don't mess with anything unless it's blowing up the matrix. If it doesn't blow up the matrix, but doesn't work, just let it go and let's figure out what it is doing and what it isn't doing.
The flow is as follows:
Once a day go out to all the directory servers besides yourself and grab a list of updates. This happens in the poller. If we've never seen them before add them to the updates table. The poller also looks to see if we're a directory server and have updates that haven't yet been processed. It calls onedirsync.php to process each one. If we contact the channel to update and don't find anything (we're just doing a basic zot_finger), set a ud_last timestamp. If this is set we will only try once a day for seven days. Then we stop trying to update.
This will probably cause a spike the first time through because you haven't seen any updates before, but we spread out the load over your delivery interval.
Diffstat (limited to 'install/update.php')
-rw-r--r-- | install/update.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/install/update.php b/install/update.php index 13f4fc63b..5c46538cf 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1074 ); +define( 'UPDATE_VERSION' , 1075 ); /** * @@ -816,11 +816,13 @@ ADD INDEX ( `ud_addr` ) "); function update_r1072() { $r = q("ALTER TABLE `xtag` ADD `xtag_flags` INT NOT NULL DEFAULT '0', ADD INDEX ( `xtag_flags` ) "); + if($r) return UPDATE_SUCCESS; return UPDATE_FAILED; } + function update_r1073() { $r1 = q("CREATE TABLE IF NOT EXISTS `source` ( `src_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , @@ -836,3 +838,16 @@ function update_r1073() { return UPDATE_SUCCESS; return UPDATE_FAILED; } + +function update_r1074() { + $r1 = q("ALTER TABLE `site` ADD `site_sync` DATETIME NOT NULL AFTER `site_update` "); + + $r2 = q("ALTER TABLE `updates` ADD `ud_last` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `ud_date` , +ADD INDEX ( `ud_last` ) "); + + if($r1 && $r2) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + + |