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 /include/zot.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 'include/zot.php')
-rw-r--r-- | include/zot.php | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/include/zot.php b/include/zot.php index 1a90481ff..33bb60c0f 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1532,13 +1532,21 @@ function import_directory_keywords($hash,$keywords) { function update_modtime($hash,$guid,$addr,$flags = 0) { - q("insert into updates (ud_hash, ud_guid, ud_date, ud_flags, ud_addr ) values ( '%s', '%s', '%s', %d, '%s' )", - dbesc($hash), - dbesc($guid), - dbesc(datetime_convert()), - intval($flags), - dbesc($addr) - ); + if($flags) { + q("insert into updates (ud_hash, ud_guid, ud_date, ud_flags, ud_addr ) values ( '%s', '%s', '%s', %d, '%s' )", + dbesc($hash), + dbesc($guid), + dbesc(datetime_convert()), + intval($flags), + dbesc($addr) + ); + } + else { + q("update updates set ud_flags = ( ud_flags | %d ) where ud_addr = '%s' and not (ud_flags & %d) ", + intval(UPDATE_FLAGS_UPDATED), + intval(UPDATE_FLAGS_UPDATED) + ); + } } |