Skip to content

Commit

Permalink
Extra cleanup and more verbose output
Browse files Browse the repository at this point in the history
  • Loading branch information
dklawren committed Dec 16, 2024
1 parent 0ed9119 commit 23fbf42
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions extensions/BMO/bin/export_bmo_etl.pl
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ sub send_data {

my $fh = path($filename)->open('>>');
print $fh encode_json($big_query) . "\n";
unless(close $fh) {
unless (close $fh) {
delete_lock();
die "Could not close $filename: $!\n";
}
Expand Down Expand Up @@ -672,7 +672,7 @@ sub _get_access_token {

if (!$res->is_success) {
delete_lock();
'Google access token failure: ' . $res->content;
die 'Google access token failure: ' . $res->content . "\n";
}

my $result = decode_json($res->decoded_content);
Expand All @@ -697,6 +697,7 @@ sub check_and_set_lock {

# Delete lock from bmo_etl_locked
sub delete_lock {
print "Deleting lock in database\n" if $verbose;
Bugzilla->dbh_main->do('DELETE FROM bmo_etl_locked');
}

Expand Down Expand Up @@ -727,6 +728,8 @@ sub check_for_duplicates {
$request->header('Content-Type' => 'application/json');
$request->content(encode_json($query));

print encode_json($query) . "\n" if $verbose;

my $res = $ua->request($request);
if (!$res->is_success) {
delete_lock();
Expand Down

0 comments on commit 23fbf42

Please sign in to comment.