comparison feeds.tcl @ 424:825cac46b1cb

Cosmetic / stray trailing whitespace cleanup.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 08 Jan 2017 03:55:55 +0200
parents 44c9128097cd
children e5810c52d376
comparison
equal deleted inserted replaced
423:44c9128097cd 424:825cac46b1cb
87 } 87 }
88 88
89 89
90 proc feeds_check_end {} { 90 proc feeds_check_end {} {
91 global feeds_dbfile 91 global feeds_dbfile
92 92
93 if {![catch {set ufile [open "$feeds_dbfile.time" w 0600]} uerrmsg]} { 93 if {![catch {set ufile [open "$feeds_dbfile.time" w 0600]} uerrmsg]} {
94 puts $ufile [clock seconds] 94 puts $ufile [clock seconds]
95 close $ufile 95 close $ufile
96 } 96 }
97 } 97 }
100 proc feeds_exec {} { 100 proc feeds_exec {} {
101 global feeds_dbh feeds_check_period feeds_running feeds_sync_limit 101 global feeds_dbh feeds_check_period feeds_running feeds_sync_limit
102 102
103 # feeds_log "Timed feed check." 103 # feeds_log "Timed feed check."
104 set oldtime [feeds_check_start] 104 set oldtime [feeds_check_start]
105
106 set usql "SELECT feed AS ufeed, title AS utitle, url AS uurl, utime AS utime FROM feeds WHERE utime > $oldtime ORDER BY utime ASC" 105 set usql "SELECT feed AS ufeed, title AS utitle, url AS uurl, utime AS utime FROM feeds WHERE utime > $oldtime ORDER BY utime ASC"
107 set nresult [feeds_dbh onecolumn "SELECT COUNT(*) FROM feeds WHERE utime > $oldtime"] 106 set nresult [feeds_dbh onecolumn "SELECT COUNT(*) FROM feeds WHERE utime > $oldtime"]
107
108 if {$nresult > $feeds_sync_limit} { 108 if {$nresult > $feeds_sync_limit} {
109 feeds_log "$nresult new entries, probably unsynchronized. Ignoring." 109 feeds_log "$nresult new entries, probably unsynchronized. Ignoring."
110 } else { 110 } else {
111 feeds_log "$nresult new entries since $oldtime .." 111 feeds_log "$nresult new entries since $oldtime .."
112 feeds_dbh eval $usql { 112 feeds_dbh eval $usql {