diff --git a/lib/GTSRSSApi.pm b/lib/GTSRSSApi.pm index b9ba7f8..c044c10 100644 --- a/lib/GTSRSSApi.pm +++ b/lib/GTSRSSApi.pm @@ -124,6 +124,7 @@ sub fetch_gts_data { $html->find('.gtsPokemonSummary.gtsOffer.pfBoxThin.pfFormGroup') ->each; my $db = GTSRSSApi::DB->connect; + local $db->{AutoCommit} = 0; $db->do( <<'EOF', undef ); UPDATE offers SET marked_to_check_is_available = true WHERE is_available = true; EOF @@ -423,6 +424,7 @@ EOF $db->do( <<'EOF', undef ); UPDATE offers SET is_available = false, marked_to_check_is_available = false = true WHERE is_available and marked_to_check_is_available; EOF + $db->commit; }; if ($@) { warn $@;