sub update_assignment_db {
my ($dbh, $channel, $ts, $assignments) = @_;
- local $dbh->{AutoCommit} = 0;
my %db_assignments = ();
my $q = $dbh->prepare('SELECT name,group_name FROM current_group_membership_history WHERE channel=? AND ts=?');
$q->execute($channel, $ts);
$q->execute($channel, $ts, $name, undef);
}
}
- $dbh->commit;
}
sub get_spreadsheet_with_title {
if (!defined($dbh)) {
return undef;
}
+ $dbh->{AutoCommit} = 0;
$dbh->do('LISTEN skvupdate') or return undef;
return $dbh;
}
@log = ();
skv_log("Siste sync startet: " . POSIX::ctime(time));
+ # For the logic on the “applied” table below.
+ $dbh->do('SET TRANSACTION ISOLATION LEVEL SERIALIZABLE');
+
my $token = get_oauth_bearer_token($dbh, $ua);
# Find the newest message, what it is linked to, and what was the one before it (for group diffing).
# Find the list of names we already marked yellow.
my %have_colors = ();
- $dbh->{AutoCommit} = 0;
- $dbh->do('SET TRANSACTION ISOLATION LEVEL SERIALIZABLE');
$q = $dbh->prepare('SELECT name,color FROM applied WHERE channel=? AND ts=?');
$q->execute($config::invitation_channel, $invitation_ts);
while (my $ref = $q->fetchrow_hashref) {
}
if (scalar @ready > 0) {
eval {
- $dbh->{AutoCommit} = 1;
run($dbh, $ua);
- $dbh->commit;
};
if ($@) {
warn "Died with: $@";
}
} elsif ($#ARGV >= 0 && $ARGV[0] eq '--benchmark') {
for my $i (0..9) {
- $dbh->{AutoCommit} = 1;
run($dbh, $ua);
- $dbh->commit;
}
} else {
run($dbh, $ua);