Skip to content

Commit

Permalink
fix: do not pin IPFS for subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Nov 16, 2024
1 parent e6480f0 commit 8ffac70
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ingestor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ const NETWORK_METADATA = {
}
};

function shouldSkipIpfsPin(type: string, body: any) {
return type === 'subscription' && body.type === 'email';
}

export default async function ingestor(req) {
if (flaggedIps.includes(sha256(getIp(req)))) {
return Promise.reject('unauthorized');
Expand Down Expand Up @@ -255,7 +259,9 @@ export default async function ingestor(req) {
...restBody
};
[pinned, receipt] = await Promise.all([
pin(ipfsBody, process.env.PINEAPPLE_URL),
shouldSkipIpfsPin(type, legacyBody)
? Promise.resolve('')
: pin(ipfsBody, process.env.PINEAPPLE_URL),
issueReceipt(formattedSignature)
]);
} catch (e) {
Expand Down

0 comments on commit 8ffac70

Please sign in to comment.