]> git.donarmstrong.com Git - infobot.git/commitdiff
reduce database calls on each factoid request by using dbSet
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 1 Nov 2002 20:48:26 +0000 (20:48 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 1 Nov 2002 20:48:26 +0000 (20:48 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@581 c11ca15a-4712-0410-83d8-924469b57eb5

src/Factoids/Reply.pl

index 5c472fc5b87f257090670bcfb9888aee7da6042a..88bc854069ea5b7c0dd3b8d6678b3ec708b75dc6 100644 (file)
@@ -61,18 +61,17 @@ sub getReply {
        ### "requested_count=requested_count+1".
        my $count = &getFactInfo($lhs,"requested_count") || 0;
        $count++;
-       ### BROKEN!!!
-       if (1) {        # old code.
+       ### BROKEN!!! - Tim Riker <Tim@Rikers.org> says it's fixed now
+       if (0) {        # old code.
            &setFactInfo($lhs,"requested_by", $nuh);
            &setFactInfo($lhs,"requested_time", time());
            &setFactInfo($lhs,"requested_count", $count);
        } else {
-           &dbReplace("factoids", "factoid_key", (
-               factoid_key     => $lhs,
+           &dbSet("factoids", {'factoid_key' => $lhs}, {
                requested_by    => $nuh,
                requested_time  => time(),
                requested_count => $count
-           ) );
+           } );
        }
 
        # todo: rename $real to something else!