sub mark {
print STDERR "Marking that a sync is needed.\n";
- open my $fh, ">", "/srv/skvidar-slack.sesse.net/marker";
- close $fh;
+ $dbh->do('NOTIFY skvupdate');
}
sub handle_event {
if ($type eq 'reaction_added' || $type eq 'reaction_removed') {
$dbh->do('INSERT INTO reaction_log (userid, channel, ts, reaction, event_type, event_ts) VALUES (?,?,?,?,?,?)', undef,
$user, $channel, $ts, $reaction, $type, $event_ts);
- mark();
+ mark($dbh);
} else {
print STDERR "Type is $type (not a reaction added or removed); ignoring.\n";
}