user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 2/1] msgmap: ignore duplicates instead of dying
  @ 2017-06-23  1:21  7% ` Eric Wong
  0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2017-06-23  1:21 UTC (permalink / raw)
  To: meta

This prevents public-inbox-watch from dying when reloading
(and thus rescanning) already-imported directories.
---
 lib/PublicInbox/Msgmap.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/Msgmap.pm b/lib/PublicInbox/Msgmap.pm
index a49b61e..7e0f34a 100644
--- a/lib/PublicInbox/Msgmap.pm
+++ b/lib/PublicInbox/Msgmap.pm
@@ -179,7 +179,7 @@ sub id_batch {
 sub mid_set {
 	my ($self, $num, $mid) = @_;
 	my $sth = $self->{mid_set} ||= do {
-		my $sql = 'INSERT INTO msgmap (num, mid) VALUES (?,?)';
+		my $sql = 'INSERT OR IGNORE INTO msgmap (num, mid) VALUES (?,?)';
 		$self->{dbh}->prepare($sql);
 	};
 	$sth->execute($num, $mid);
-- 
EW

^ permalink raw reply related	[relevance 7%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2017-06-22 22:01     [PATCH] msgmap: mid_insert ignores duplicates instead of die-ing Eric Wong
2017-06-23  1:21  7% ` [PATCH 2/1] msgmap: ignore duplicates instead of dying Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).