Skip to content
Extraits de code Groupes Projets
Valider 33407b16 rédigé par Alexandre Morignot's avatar Alexandre Morignot
Parcourir les fichiers

utils::db::get_session() becomes utils::db::get_new_session()

parent 212494d2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -30,7 +30,7 @@ sub exec {
my @words = ($msg =~ /(?:^| )([^#\s]+)/g);
if (not defined $last_req or $msg ne $last_req) {
my $dbh = utils::db::get_session;
my $dbh = utils::db::get_new_session;
my @words_param;
foreach (@words) {
......@@ -129,7 +129,7 @@ sub exec {
# this is specific to the mysql driver
$rows = $sth->rows;
my $sth2 = utils::db::get_session()->prepare("select tag
my $sth2 = utils::db::get_new_session()->prepare("select tag
from playbot_tags
where id = ?
");
......@@ -157,7 +157,7 @@ sub exec {
$irc->yield(privmsg => $chan => $irc_msg);
# we save the get like a post
$sth2 = utils::db::get_session()->prepare_cached('
$sth2 = utils::db::get_new_session()->prepare_cached('
INSERT INTO playbot_chan (content, chan, sender_irc)
VALUES (?,?,?)');
$log->error("Couldn't prepare querie; aborting") unless (defined $sth2);
......
......@@ -19,7 +19,7 @@ BEGIN {
}
sub get_session {
sub get_new_session {
my $dbh = DBI->connect('DBI:mysql:'.$conf->{'bdd'}.';host='.$conf->{'host'}, $conf->{'user'}, $conf->{'passwd'}, {
PrintError => 0,
AutoCommit => 1,
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter