fix: remove await in non-async init() causing SyntaxError on startup
dropIndex() was called with await inside the non-async init() method, causing "Unexpected reserved word" and preventing Indiekit from starting. Use promise .catch() instead since the result isn't needed.
This commit is contained in:
@@ -952,8 +952,8 @@ export default class ActivityPubEndpoint {
|
|||||||
|
|
||||||
// Drop non-sparse indexes if they exist (created by earlier versions),
|
// Drop non-sparse indexes if they exist (created by earlier versions),
|
||||||
// then recreate with sparse:true so multiple null values are allowed.
|
// then recreate with sparse:true so multiple null values are allowed.
|
||||||
try { await this._collections.ap_muted.dropIndex("url_1"); } catch {}
|
this._collections.ap_muted.dropIndex("url_1").catch(() => {});
|
||||||
try { await this._collections.ap_muted.dropIndex("keyword_1"); } catch {}
|
this._collections.ap_muted.dropIndex("keyword_1").catch(() => {});
|
||||||
this._collections.ap_muted.createIndex(
|
this._collections.ap_muted.createIndex(
|
||||||
{ url: 1 },
|
{ url: 1 },
|
||||||
{ unique: true, sparse: true, background: true },
|
{ unique: true, sparse: true, background: true },
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@rmdes/indiekit-endpoint-activitypub",
|
"name": "@rmdes/indiekit-endpoint-activitypub",
|
||||||
"version": "2.0.15",
|
"version": "2.0.16",
|
||||||
"description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
|
"description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"indiekit",
|
"indiekit",
|
||||||
|
|||||||
Reference in New Issue
Block a user