fix: bg purport reseed
This commit is contained in:
+10
-4
@@ -307,11 +307,17 @@ func indexVerses(sugar *zap.SugaredLogger, tsClient *typesense.Client, mongoDB *
|
||||
TokenSeparators: &hyphenSeparators,
|
||||
}
|
||||
|
||||
_, err := tsClient.Collections().Create(context.Background(), schema)
|
||||
if err != nil {
|
||||
sugar.Fatalf("[verses] Failed to create collection: %v", err)
|
||||
// Create the collection; tolerate "already exists" so a --no-drop run can
|
||||
// upsert into the live collection without dropping it (matches indexProse).
|
||||
if _, err := tsClient.Collections().Create(context.Background(), schema); err != nil {
|
||||
if strings.Contains(err.Error(), "already exists") {
|
||||
sugar.Warnf("[verses] Create collection: %v (continuing — upserting into existing)", err)
|
||||
} else {
|
||||
sugar.Fatalf("[verses] Failed to create collection: %v", err)
|
||||
}
|
||||
} else {
|
||||
sugar.Info("[verses] Collection created")
|
||||
}
|
||||
sugar.Info("[verses] Collection created")
|
||||
|
||||
// Read from MongoDB
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
|
||||
|
||||
Reference in New Issue
Block a user