Adding transaction to the bot.
This commit is contained in:
parent
4ba198be51
commit
42dc2fb56e
@ -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 $@;
|
||||
|
Loading…
Reference in New Issue
Block a user