PolicyWorker: move Deno.env set above imports

This commit is contained in:
Alex Gleason 2025-02-26 18:14:42 -06:00
parent ccf6d2074e
commit 55115d3592
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -1,3 +1,6 @@
// @ts-ignore Don't try to access the env from this worker.
Deno.env = new Map<string, string>();
import { DittoPolyPg } from '@ditto/db'; import { DittoPolyPg } from '@ditto/db';
import '@soapbox/safe-fetch/load'; import '@soapbox/safe-fetch/load';
import { NostrEvent, NostrRelayOK, NPolicy } from '@nostrify/nostrify'; import { NostrEvent, NostrRelayOK, NPolicy } from '@nostrify/nostrify';
@ -6,9 +9,6 @@ import * as Comlink from 'comlink';
import { DittoPgStore } from '@/storages/DittoPgStore.ts'; import { DittoPgStore } from '@/storages/DittoPgStore.ts';
// @ts-ignore Don't try to access the env from this worker.
Deno.env = new Map<string, string>();
/** Serializable object the worker can use to set up the state. */ /** Serializable object the worker can use to set up the state. */
interface PolicyInit { interface PolicyInit {
/** Path to the policy module (https, jsr, file, etc) */ /** Path to the policy module (https, jsr, file, etc) */