diff options
author | Eric Wong <e@yhbt.net> | 2020-08-28 10:12:59 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-08-28 22:19:27 +0000 |
commit | 64f4a7c22d570097f316a5cbaf25b99a412bf54d (patch) | |
tree | 8532835e0223d28982db12836f6a5bac452fb92c /lib/PublicInbox/IMAPTracker.pm | |
parent | b1054300d1e33cb7b2279922c8f73628551fbf8f (diff) | |
download | public-inbox-64f4a7c22d570097f316a5cbaf25b99a412bf54d.tar.gz |
By making it a no-op if last_uid is not defined. This isn't a hot code path, so the extra method dispatch isn't an issue. It'll save some indentation/wrapping in future commits.
Diffstat (limited to 'lib/PublicInbox/IMAPTracker.pm')
-rw-r--r-- | lib/PublicInbox/IMAPTracker.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/IMAPTracker.pm b/lib/PublicInbox/IMAPTracker.pm index 92f21584..be9caf76 100644 --- a/lib/PublicInbox/IMAPTracker.pm +++ b/lib/PublicInbox/IMAPTracker.pm @@ -49,13 +49,14 @@ SELECT uid_validity, uid FROM imap_last WHERE url = ? } sub update_last ($$$) { - my ($self, $validity, $last) = @_; + my ($self, $validity, $last_uid) = @_; + return unless defined $last_uid; my $sth = $self->{dbh}->prepare_cached(<<''); INSERT OR REPLACE INTO imap_last (url, uid_validity, uid) VALUES (?, ?, ?) $self->lock_acquire; - my $rv = $sth->execute($self->{url}, $validity, $last); + my $rv = $sth->execute($self->{url}, $validity, $last_uid); $self->lock_release; $rv; } |