]> git.donarmstrong.com Git - infobot.git/commitdiff
* Fixed a bug that caused seen stats flush to crash related to sqlite not having...
authordjmcgrath <djmcgrath@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 15 Apr 2008 04:14:14 +0000 (04:14 +0000)
committerdjmcgrath <djmcgrath@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 15 Apr 2008 04:14:14 +0000 (04:14 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1658 c11ca15a-4712-0410-83d8-924469b57eb5

src/IRC/Schedulers.pl

index 7907ec40aca8d97b83915f153b1f17cc80eb1228..e854d1e8e539905ed6e82184f4609d0a6ff57a82 100644 (file)
@@ -254,9 +254,12 @@ sub seenFlushOld {
     if ($param{'DBType'} =~ /^(pgsql|mysql|sqlite(2)?)$/i) {
        my $query;
 
-       if ($param{'DBType'} =~ /^(mysql|sqlite(2)?)$/i) {
+       if ($param{'DBType'} =~ /^mysql$/i) {
            $query = "SELECT nick,time FROM seen GROUP BY nick HAVING ".
                        "UNIX_TIMESTAMP() - time > $max_time";
+    } elsif ($param{'DBType'} =~ /^sqlite(2)?$/i) {
+        $query = "SELECT nick,time FROM seen GROUP BY nick HAVING ".
+            "strftime('%s','now','localtime') - time > $max_time";
        } else {        # pgsql.
            $query = "SELECT nick,time FROM seen WHERE ".
                "extract(epoch from timestamp 'now') - time > $max_time";