diff options
author | Paolo T <tuscanhobbit@users.noreply.github.com> | 2014-09-02 13:15:59 +0200 |
---|---|---|
committer | Paolo T <tuscanhobbit@users.noreply.github.com> | 2014-09-02 13:15:59 +0200 |
commit | fee5b6bd1599599da2f3b662f04b9651b23fb4e4 (patch) | |
tree | e4ab47f657ce1e6ae0aabf6be51bdf169e4b389d /include/queue.php | |
parent | a1f85cda3ec0e6fc1c661ee12b1e7d87b3f242c5 (diff) | |
parent | 9dac46ca25b11f80dded42db31e7e062fc7b5142 (diff) | |
download | volse-hubzilla-fee5b6bd1599599da2f3b662f04b9651b23fb4e4.tar.gz volse-hubzilla-fee5b6bd1599599da2f3b662f04b9651b23fb4e4.tar.bz2 volse-hubzilla-fee5b6bd1599599da2f3b662f04b9651b23fb4e4.zip |
Merge pull request #2 from friendica/master
Merge from main project
Diffstat (limited to 'include/queue.php')
-rw-r--r-- | include/queue.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/include/queue.php b/include/queue.php index 239d61fc0..222ebada4 100644 --- a/include/queue.php +++ b/include/queue.php @@ -38,7 +38,7 @@ function queue_run($argv, $argc){ // The zot driver will deliver everything destined for a single hub once contact is made (*if* contact is made). // Other drivers will have to do something different here and may need their own query. - $r = q("SELECT * FROM outq WHERE outq_delivered = 0 and (( outq_created > UTC_TIMESTAMP() - INTERVAL 12 HOUR and outq_updated < UTC_TIMESTAMP() - INTERVAL 15 MINUTE ) OR ( outq_updated < UTC_TIMESTAMP() - INTERVAL 1 HOUR )) and outq_driver in ('','zot') group by outq_posturl"); + $r = q("SELECT * FROM outq WHERE outq_delivered = 0 and (( outq_created > UTC_TIMESTAMP() - INTERVAL 12 HOUR and outq_updated < UTC_TIMESTAMP() - INTERVAL 15 MINUTE ) OR ( outq_updated < UTC_TIMESTAMP() - INTERVAL 1 HOUR )) group by outq_posturl"); } if(! $r) return; @@ -46,6 +46,24 @@ function queue_run($argv, $argc){ foreach($r as $rr) { if(in_array($rr['outq_posturl'],$deadguys)) continue; + + if($rr['outq_driver'] === 'post') { + $result = z_post_url($rr['outq_posturl'],$rr['outq_msg']); + if($result['success'] && $result['return_code'] < 300) { + logger('queue: queue post success to ' . $rr['outq_posturl'], LOGGER_DEBUG); + $y = q("delete from outq where outq_hash = '%s' limit 1", + dbesc($rr['ouq_hash']) + ); + } + else { + logger('queue: queue post returned ' . $result['return_code'] . ' from ' . $rr['outq_posturl'],LOGGER_DEBUG); + $y = q("update outq set outq_updated = '%s' where outq_hash = '%s' limit 1", + dbesc(datetime_convert()), + dbesc($rr['outq_hash']) + ); + } + continue; + } $result = zot_zot($rr['outq_posturl'],$rr['outq_notify']); if($result['success']) { zot_process_response($rr['outq_posturl'],$result, $rr); |