From e992cfeca9a80583b7cde12776fcfe279be02996 Mon Sep 17 00:00:00 2001
From: friendica <info@friendica.com>
Date: Mon, 30 Sep 2013 18:33:27 -0700
Subject: 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.
---
 install/database.sql | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'install/database.sql')

diff --git a/install/database.sql b/install/database.sql
index c92428975..77070027c 100644
--- a/install/database.sql
+++ b/install/database.sql
@@ -823,6 +823,7 @@ CREATE TABLE IF NOT EXISTS `site` (
   `site_access` int(11) NOT NULL DEFAULT '0',
   `site_flags` int(11) NOT NULL DEFAULT '0',
   `site_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+  `site_sync` datetime NOT NULL,
   `site_directory` char(255) NOT NULL DEFAULT '',
   `site_register` int(11) NOT NULL DEFAULT '0',
   `site_sellpage` char(255) NOT NULL DEFAULT '',
@@ -903,6 +904,7 @@ CREATE TABLE IF NOT EXISTS `updates` (
   `ud_hash` char(128) NOT NULL,
   `ud_guid` char(255) NOT NULL DEFAULT '',
   `ud_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+  `ud_last` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
   `ud_flags` int(11) NOT NULL DEFAULT '0',
   `ud_addr` char(255) NOT NULL DEFAULT '',
   PRIMARY KEY (`ud_id`),
@@ -910,7 +912,8 @@ CREATE TABLE IF NOT EXISTS `updates` (
   KEY `ud_guid` (`ud_guid`),
   KEY `ud_date` (`ud_date`),
   KEY `ud_flags` (`ud_flags`),
-  KEY `ud_addr` (`ud_addr`)
+  KEY `ud_addr` (`ud_addr`),
+  KEY `ud_last` (`ud_last`)
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
 CREATE TABLE IF NOT EXISTS `verify` (
-- 
cgit v1.2.3

