querysub 0.437.0 → 0.439.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +50 -50
- package/bin/deploy.js +0 -0
- package/bin/function.js +0 -0
- package/bin/server.js +0 -0
- package/costsBenefits.txt +115 -115
- package/deploy.ts +2 -2
- package/package.json +2 -2
- package/spec.txt +1192 -1192
- package/src/-a-archives/archives.ts +202 -202
- package/src/-a-archives/archivesDisk.ts +454 -454
- package/src/-a-auth/certs.ts +540 -540
- package/src/-a-auth/node-forge-ed25519.d.ts +16 -16
- package/src/-b-authorities/dnsAuthority.ts +138 -138
- package/src/-c-identity/IdentityController.ts +258 -258
- package/src/-d-trust/NetworkTrust2.ts +180 -180
- package/src/-e-certs/EdgeCertController.ts +252 -252
- package/src/-e-certs/certAuthority.ts +201 -201
- package/src/-f-node-discovery/NodeDiscovery.ts +640 -640
- package/src/-g-core-values/NodeCapabilities.ts +200 -200
- package/src/-h-path-value-serialize/stringSerializer.ts +175 -175
- package/src/0-path-value-core/PathValueCommitter.ts +468 -468
- package/src/0-path-value-core/PathValueController.ts +0 -2
- package/src/0-path-value-core/archiveLocks/archiveSnapshots.ts +37 -1
- package/src/0-path-value-core/pathValueCore.ts +12 -0
- package/src/2-proxy/PathValueProxyWatcher.ts +2542 -2542
- package/src/2-proxy/TransactionDelayer.ts +94 -94
- package/src/2-proxy/pathDatabaseProxyBase.ts +36 -36
- package/src/2-proxy/pathValueProxy.ts +159 -159
- package/src/3-path-functions/PathFunctionRunner.ts +24 -13
- package/src/3-path-functions/PathFunctionRunnerMain.ts +87 -87
- package/src/3-path-functions/pathFunctionLoader.ts +516 -516
- package/src/3-path-functions/tests/rejectTest.ts +76 -76
- package/src/4-deploy/deployCheck.ts +6 -6
- package/src/4-dom/css.tsx +29 -29
- package/src/4-dom/cssTypes.d.ts +211 -211
- package/src/4-dom/qreact.tsx +2799 -2799
- package/src/4-dom/qreactTest.tsx +410 -410
- package/src/4-querysub/permissions.ts +335 -335
- package/src/4-querysub/querysubPrediction.ts +483 -483
- package/src/5-diagnostics/qreactDebug.tsx +400 -346
- package/src/TestController.ts +34 -34
- package/src/bits.ts +104 -104
- package/src/buffers.ts +69 -69
- package/src/diagnostics/ActionsHistory.ts +57 -57
- package/src/diagnostics/PathDistributionInfo.tsx +9 -1
- package/src/diagnostics/listenOnDebugger.ts +71 -71
- package/src/diagnostics/logs/IndexedLogs/BufferUnitIndex.ts +1 -1
- package/src/diagnostics/logs/diskLogger.ts +6 -0
- package/src/diagnostics/misc-pages/SnapshotViewer.tsx +78 -1
- package/src/diagnostics/periodic.ts +111 -111
- package/src/diagnostics/trackResources.ts +91 -91
- package/src/diagnostics/watchdog.ts +120 -120
- package/src/errors.ts +133 -133
- package/src/forceProduction.ts +2 -2
- package/src/fs.ts +80 -80
- package/src/functional/diff.ts +857 -857
- package/src/functional/promiseCache.ts +78 -78
- package/src/functional/random.ts +8 -8
- package/src/functional/stats.ts +60 -60
- package/src/heapDumps.ts +665 -665
- package/src/https.ts +1 -1
- package/src/library-components/AspectSizedComponent.tsx +87 -87
- package/src/library-components/ButtonSelector.tsx +64 -64
- package/src/library-components/DropdownCustom.tsx +150 -150
- package/src/library-components/DropdownSelector.tsx +31 -31
- package/src/library-components/InlinePopup.tsx +66 -66
- package/src/library-components/uncaughtToast.tsx +2 -0
- package/src/misc/color.ts +29 -29
- package/src/misc/hash.ts +83 -83
- package/src/misc/ipPong.js +13 -13
- package/src/misc/networking.ts +1 -1
- package/src/misc/random.ts +44 -44
- package/src/misc.ts +196 -196
- package/src/path.ts +255 -255
- package/src/persistentLocalStore.ts +41 -41
- package/src/promise.ts +14 -14
- package/src/storage/fileSystemPointer.ts +71 -71
- package/src/test/heapProcess.ts +35 -35
- package/src/zip.ts +15 -15
- package/tsconfig.json +26 -26
- package/yarnSpec.txt +56 -56
|
@@ -9,7 +9,7 @@ import { getPathFromStr, getPathIndex } from "../path";
|
|
|
9
9
|
import { rawSchema } from "../2-proxy/pathDatabaseProxyBase";
|
|
10
10
|
import { getProxyPath } from "../2-proxy/pathValueProxy";
|
|
11
11
|
import { atomicObjectRead, atomicObjectWrite, doProxyOptions, isProxyBlockedByOrder, isSynced, proxyWatcher } from "../2-proxy/PathValueProxyWatcher";
|
|
12
|
-
import { authorityStorage, compareTime, debugTime, MAX_ACCEPTED_CHANGE_AGE, PathValue, Time } from "../0-path-value-core/pathValueCore";
|
|
12
|
+
import { authorityStorage, compareTime, debugTime, MAX_ACCEPTED_CHANGE_AGE, parseDebugTime, PathValue, Time } from "../0-path-value-core/pathValueCore";
|
|
13
13
|
import { getModuleFromSpec } from "./pathFunctionLoader";
|
|
14
14
|
import debugbreak from "debugbreak";
|
|
15
15
|
import { parseArgs } from "./PathFunctionHelpers";
|
|
@@ -164,6 +164,15 @@ function getDebugName(call: CallSpec, functionSpec: FunctionSpec | undefined, co
|
|
|
164
164
|
return `${mainPart}`;
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
+
export function parseDebugName(debugName: string) {
|
|
168
|
+
let parts = debugName.split("|");
|
|
169
|
+
if (parts.length !== 3) return undefined;
|
|
170
|
+
return {
|
|
171
|
+
file: parts[0],
|
|
172
|
+
functionId: parts[1],
|
|
173
|
+
runAtTime: parseDebugTime(parts[2]),
|
|
174
|
+
};
|
|
175
|
+
}
|
|
167
176
|
|
|
168
177
|
type PermissionsCheckType = {
|
|
169
178
|
new(callerMachineId: { callerMachineId: string; callerIP: string; }): {
|
|
@@ -531,7 +540,9 @@ export class PathFunctionRunner {
|
|
|
531
540
|
return;
|
|
532
541
|
}
|
|
533
542
|
|
|
534
|
-
|
|
543
|
+
let debugNameColored = getDebugName(callSpec, functionSpec, true);
|
|
544
|
+
let debugName = getDebugName(callSpec, functionSpec);
|
|
545
|
+
console.info(`New function call: ${debugNameColored}`, {
|
|
535
546
|
callId: callSpec.CallId,
|
|
536
547
|
timeId: callSpec.runAtTime.time,
|
|
537
548
|
functionId: callSpec.FunctionId,
|
|
@@ -564,13 +575,13 @@ export class PathFunctionRunner {
|
|
|
564
575
|
}
|
|
565
576
|
if (PathFunctionRunner.DEBUG_CALLS) {
|
|
566
577
|
let fraction = getRoutingOverridePart(callSpec.CallId)?.route;
|
|
567
|
-
console.log(`${yellow("Function run fallback")} (primary servery failed to run function) after ${formatTime(secondaryDelay)}. Fraction ${fraction?.toFixed(3)}. Primary ${this.config.shardRange.startFraction.toFixed(3)} to ${this.config.shardRange.endFraction.toFixed(3)}. Secondary ${this.config.secondaryShardRange?.startFraction.toFixed(3)} to ${this.config.secondaryShardRange?.endFraction.toFixed(3)}. for ${
|
|
578
|
+
console.log(`${yellow("Function run fallback")} (primary servery failed to run function) after ${formatTime(secondaryDelay)}. Fraction ${fraction?.toFixed(3)}. Primary ${this.config.shardRange.startFraction.toFixed(3)} to ${this.config.shardRange.endFraction.toFixed(3)}. Secondary ${this.config.secondaryShardRange?.startFraction.toFixed(3)} to ${this.config.secondaryShardRange?.endFraction.toFixed(3)}. for ${debugNameColored}`);
|
|
568
579
|
}
|
|
569
580
|
}
|
|
570
581
|
|
|
571
582
|
PathFunctionRunner.RUN_START_COUNT++;
|
|
572
583
|
if (PathFunctionRunner.DEBUG_CALLS) {
|
|
573
|
-
console.log(`STARTING ${
|
|
584
|
+
console.log(`STARTING ${debugNameColored}`);
|
|
574
585
|
}
|
|
575
586
|
let startTime = Date.now();
|
|
576
587
|
let runCount = 0;
|
|
@@ -618,29 +629,29 @@ export class PathFunctionRunner {
|
|
|
618
629
|
devFunctionMetadata = schemaObj?.functionMetadata?.[functionSpec.FunctionId];
|
|
619
630
|
}
|
|
620
631
|
|
|
621
|
-
console.info(`Running function: ${
|
|
632
|
+
console.info(`Running function: ${debugNameColored}`, {
|
|
622
633
|
callId: callSpec.CallId,
|
|
623
634
|
outerLoop: retries,
|
|
624
635
|
});
|
|
625
636
|
|
|
626
637
|
await proxyWatcher.commitFunction({
|
|
627
638
|
canWrite: true,
|
|
628
|
-
debugName:
|
|
639
|
+
debugName: debugName,
|
|
640
|
+
source: debugName,
|
|
629
641
|
runAtTime: callSpec.runAtTime,
|
|
630
642
|
getPermissionsCheck: PermissionsChecker && (() => new PermissionsChecker(callSpec)),
|
|
631
643
|
nestedCalls: "inline",
|
|
632
644
|
temporary: true,
|
|
633
645
|
maxLocksOverride: devFunctionMetadata ? devFunctionMetadata.maxLocksOverride : functionSpec.maxLocksOverride,
|
|
634
|
-
source: callSpec.CallId,
|
|
635
646
|
watchFunction: function runCallWatcher() {
|
|
636
647
|
runCount++;
|
|
637
648
|
stats.lastInternalLoopCount = runCount;
|
|
638
649
|
stats.totalInternalLoopCount++;
|
|
639
650
|
if (PathFunctionRunner.DEBUG_CALLS) {
|
|
640
|
-
console.log(`Evaluating (try count ${runCount}) ${
|
|
651
|
+
console.log(`Evaluating (try count ${runCount}) ${debugNameColored}`);
|
|
641
652
|
}
|
|
642
653
|
if (runCount > PathFunctionRunner.MAX_WATCH_LOOPS) {
|
|
643
|
-
let errorMessage = `MAX_WATCH_LOOPS exceeded for ${
|
|
654
|
+
let errorMessage = `MAX_WATCH_LOOPS exceeded for ${debugNameColored}. All accesses have to be consistent. So Querysub.time() instead of Date.now() and Querysub.nextId() instead of nextId() / Math.random(). If you need multiple random numbers, keep track of an index, and pass it to Querysub.nextId() for the nth random number.`;
|
|
644
655
|
console.error(errorMessage, {
|
|
645
656
|
callId: callSpec.CallId,
|
|
646
657
|
runCount,
|
|
@@ -662,7 +673,7 @@ export class PathFunctionRunner {
|
|
|
662
673
|
atomicObjectRead(syncedModule.Sources[callSpec.FunctionId])
|
|
663
674
|
);
|
|
664
675
|
if (!syncedSpec) {
|
|
665
|
-
throw new Error(`Function spec not found for ${
|
|
676
|
+
throw new Error(`Function spec not found for ${debugNameColored}`);
|
|
666
677
|
}
|
|
667
678
|
|
|
668
679
|
// (We also need to depend on the RIGHT function spec).
|
|
@@ -775,7 +786,7 @@ export class PathFunctionRunner {
|
|
|
775
786
|
// }
|
|
776
787
|
//if (PathFunctionRunner.DEBUG_CALLS)
|
|
777
788
|
{
|
|
778
|
-
console.log(`Function run error ${
|
|
789
|
+
console.log(`Function run error ${debugNameColored}`, {
|
|
779
790
|
callId: callSpec.CallId,
|
|
780
791
|
error: e.stack,
|
|
781
792
|
});
|
|
@@ -799,7 +810,7 @@ export class PathFunctionRunner {
|
|
|
799
810
|
}
|
|
800
811
|
|
|
801
812
|
if (PathFunctionRunner.DEBUG_CALLS) {
|
|
802
|
-
console.log(`FINISHED${nooped ? " (skipped)" : ""} ${
|
|
813
|
+
console.log(`FINISHED${nooped ? " (skipped)" : ""} ${debugNameColored}, writes: ${finalWrites?.length}, took ${blue(formatTime(Date.now() - startTime))}`);
|
|
803
814
|
}
|
|
804
815
|
|
|
805
816
|
let wallTime = Date.now() - startTime;
|
|
@@ -814,7 +825,7 @@ export class PathFunctionRunner {
|
|
|
814
825
|
});
|
|
815
826
|
}
|
|
816
827
|
|
|
817
|
-
console.info(`Finished function evaluation: ${
|
|
828
|
+
console.info(`Finished function evaluation: ${debugNameColored}`, {
|
|
818
829
|
callId: callSpec.CallId,
|
|
819
830
|
outerLoop: retries,
|
|
820
831
|
finalWrites: finalWrites?.length,
|
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
// import { disableMeasurements } from "socket-function/src/profiling/measure";
|
|
2
|
-
// disableMeasurements();
|
|
3
|
-
|
|
4
|
-
import "../inject";
|
|
5
|
-
import yargs from "yargs";
|
|
6
|
-
let yargObj = yargs(process.argv)
|
|
7
|
-
.option("fncshard", { type: "string", default: "0-1", desc: "Shard range as start-end (e.g., '0-0.5' or '0.25-0.75')" })
|
|
8
|
-
.option("fncsecshard", { type: "string", default: "", desc: "Secondary shard range as start-end (e.g., '0-0.5'). Values in this range (not matched in fncshard) are delayed." })
|
|
9
|
-
.option("filter", { type: "string", default: "", desc: `Filter to only include handle specific function calls (fncshard is still applied). For example, "a&b|c", using regular boolean rules.` })
|
|
10
|
-
.argv
|
|
11
|
-
;
|
|
12
|
-
|
|
13
|
-
import { logErrors } from "../errors";
|
|
14
|
-
import { PathFunctionRunner } from "./PathFunctionRunner";
|
|
15
|
-
import { SocketFunction } from "socket-function/SocketFunction";
|
|
16
|
-
import { getThreadKeyCert } from "../-a-auth/certs";
|
|
17
|
-
import { ClientWatcher } from "../1-path-client/pathValueClientWatcher";
|
|
18
|
-
import { timeInMinute } from "socket-function/src/misc";
|
|
19
|
-
import { getDomain, isLocal, isPublic } from "../config";
|
|
20
|
-
import { green, magenta } from "socket-function/src/formatting/logColors";
|
|
21
|
-
import { parseFilterSelector } from "../misc/filterable";
|
|
22
|
-
import path from "path";
|
|
23
|
-
import { IndexedLogs } from "../diagnostics/logs/IndexedLogs/IndexedLogs";
|
|
24
|
-
|
|
25
|
-
async function main() {
|
|
26
|
-
const { PermissionsCheck } = await import("../4-querysub/permissions");
|
|
27
|
-
const { Querysub } = await import("../4-querysub/QuerysubController");
|
|
28
|
-
Error.stackTraceLimit = 20;
|
|
29
|
-
|
|
30
|
-
//ActionsHistory.LOG_ACTION_HISTORY = "runner";
|
|
31
|
-
|
|
32
|
-
// ClientWatcher.DEBUG_READS = true;
|
|
33
|
-
//ClientWatcher.DEBUG_WRITES = true;
|
|
34
|
-
// ClientWatcher.DEBUG_TRIGGERS = "heavy";
|
|
35
|
-
// authorityStorage.DEBUG_UNWATCH = true;
|
|
36
|
-
|
|
37
|
-
Querysub.SEND_FULL_HISTORY_ON_INITIAL_SYNC = true;
|
|
38
|
-
|
|
39
|
-
PathFunctionRunner.DEBUG_CALLS = true;
|
|
40
|
-
// debugCoreMode();
|
|
41
|
-
|
|
42
|
-
await Querysub.hostService("PathFunctionRunnerMain");
|
|
43
|
-
|
|
44
|
-
// Use a fairly high stick time (the default is 10s), because having wait to sync data is very slow,
|
|
45
|
-
// and the function runner SHOULD have more memory than the clients, and much faster network speeds
|
|
46
|
-
// (it should be on the same local network as the path value authorities).
|
|
47
|
-
ClientWatcher.WATCH_STICK_TIME = timeInMinute * 5;
|
|
48
|
-
|
|
49
|
-
let [shardStart, shardEnd] = yargObj.fncshard.split("-").map(v => parseFloat(v));
|
|
50
|
-
if (isNaN(shardStart) || isNaN(shardEnd)) {
|
|
51
|
-
throw new Error(`Invalid fncshard format: ${yargObj.fncshard}. Expected format like "0-0.5"`);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
let secondaryShardRange: { startFraction: number; endFraction: number } | undefined;
|
|
55
|
-
if (yargObj.fncsecshard) {
|
|
56
|
-
const [secondaryStart, secondaryEnd] = yargObj.fncsecshard.split("-").map(v => parseFloat(v));
|
|
57
|
-
if (isNaN(secondaryStart) || isNaN(secondaryEnd)) {
|
|
58
|
-
throw new Error(`Invalid fncsecshard format: ${yargObj.fncsecshard}. Expected format like "0-0.5"`);
|
|
59
|
-
}
|
|
60
|
-
secondaryShardRange = { startFraction: secondaryStart, endFraction: secondaryEnd };
|
|
61
|
-
console.log(green(`Sharding from ${shardStart} to ${shardEnd}. Fallback sharding (dead function recovery) from ${secondaryStart} to ${secondaryEnd}`));
|
|
62
|
-
} else {
|
|
63
|
-
console.log(green(`Sharding from ${shardStart} to ${shardEnd}`));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
let filterSelector = parseFilterSelector(yargObj.filter);
|
|
67
|
-
|
|
68
|
-
new PathFunctionRunner({
|
|
69
|
-
domainName: getDomain(),
|
|
70
|
-
shardRange: { startFraction: shardStart, endFraction: shardEnd },
|
|
71
|
-
secondaryShardRange,
|
|
72
|
-
// TODO: Maybe abstract this out even more, so anything can plug in permissions checks?
|
|
73
|
-
PermissionsChecker: PermissionsCheck,
|
|
74
|
-
filterSelector,
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
if (!isPublic()) {
|
|
78
|
-
// We have to import deploy, otherwise local moduleIds won't be known about
|
|
79
|
-
let deployPath = path.resolve("./deploy.ts");
|
|
80
|
-
await import(deployPath);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (yargObj.filter) {
|
|
84
|
-
console.log(magenta(`Only running functions that match the filter: ${yargObj.filter}. Either use --fncfilter dev in your http server to can calls here, or use ?setfncfilter=${yargObj.filter} in the browser to trigger functions that match this filter.`));
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
logErrors(main());
|
|
1
|
+
// import { disableMeasurements } from "socket-function/src/profiling/measure";
|
|
2
|
+
// disableMeasurements();
|
|
3
|
+
|
|
4
|
+
import "../inject";
|
|
5
|
+
import yargs from "yargs";
|
|
6
|
+
let yargObj = yargs(process.argv)
|
|
7
|
+
.option("fncshard", { type: "string", default: "0-1", desc: "Shard range as start-end (e.g., '0-0.5' or '0.25-0.75')" })
|
|
8
|
+
.option("fncsecshard", { type: "string", default: "", desc: "Secondary shard range as start-end (e.g., '0-0.5'). Values in this range (not matched in fncshard) are delayed." })
|
|
9
|
+
.option("filter", { type: "string", default: "", desc: `Filter to only include handle specific function calls (fncshard is still applied). For example, "a&b|c", using regular boolean rules.` })
|
|
10
|
+
.argv
|
|
11
|
+
;
|
|
12
|
+
|
|
13
|
+
import { logErrors } from "../errors";
|
|
14
|
+
import { PathFunctionRunner } from "./PathFunctionRunner";
|
|
15
|
+
import { SocketFunction } from "socket-function/SocketFunction";
|
|
16
|
+
import { getThreadKeyCert } from "../-a-auth/certs";
|
|
17
|
+
import { ClientWatcher } from "../1-path-client/pathValueClientWatcher";
|
|
18
|
+
import { timeInMinute } from "socket-function/src/misc";
|
|
19
|
+
import { getDomain, isLocal, isPublic } from "../config";
|
|
20
|
+
import { green, magenta } from "socket-function/src/formatting/logColors";
|
|
21
|
+
import { parseFilterSelector } from "../misc/filterable";
|
|
22
|
+
import path from "path";
|
|
23
|
+
import { IndexedLogs } from "../diagnostics/logs/IndexedLogs/IndexedLogs";
|
|
24
|
+
|
|
25
|
+
async function main() {
|
|
26
|
+
const { PermissionsCheck } = await import("../4-querysub/permissions");
|
|
27
|
+
const { Querysub } = await import("../4-querysub/QuerysubController");
|
|
28
|
+
Error.stackTraceLimit = 20;
|
|
29
|
+
|
|
30
|
+
//ActionsHistory.LOG_ACTION_HISTORY = "runner";
|
|
31
|
+
|
|
32
|
+
// ClientWatcher.DEBUG_READS = true;
|
|
33
|
+
//ClientWatcher.DEBUG_WRITES = true;
|
|
34
|
+
// ClientWatcher.DEBUG_TRIGGERS = "heavy";
|
|
35
|
+
// authorityStorage.DEBUG_UNWATCH = true;
|
|
36
|
+
|
|
37
|
+
Querysub.SEND_FULL_HISTORY_ON_INITIAL_SYNC = true;
|
|
38
|
+
|
|
39
|
+
PathFunctionRunner.DEBUG_CALLS = true;
|
|
40
|
+
// debugCoreMode();
|
|
41
|
+
|
|
42
|
+
await Querysub.hostService("PathFunctionRunnerMain");
|
|
43
|
+
|
|
44
|
+
// Use a fairly high stick time (the default is 10s), because having wait to sync data is very slow,
|
|
45
|
+
// and the function runner SHOULD have more memory than the clients, and much faster network speeds
|
|
46
|
+
// (it should be on the same local network as the path value authorities).
|
|
47
|
+
ClientWatcher.WATCH_STICK_TIME = timeInMinute * 5;
|
|
48
|
+
|
|
49
|
+
let [shardStart, shardEnd] = yargObj.fncshard.split("-").map(v => parseFloat(v));
|
|
50
|
+
if (isNaN(shardStart) || isNaN(shardEnd)) {
|
|
51
|
+
throw new Error(`Invalid fncshard format: ${yargObj.fncshard}. Expected format like "0-0.5"`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let secondaryShardRange: { startFraction: number; endFraction: number } | undefined;
|
|
55
|
+
if (yargObj.fncsecshard) {
|
|
56
|
+
const [secondaryStart, secondaryEnd] = yargObj.fncsecshard.split("-").map(v => parseFloat(v));
|
|
57
|
+
if (isNaN(secondaryStart) || isNaN(secondaryEnd)) {
|
|
58
|
+
throw new Error(`Invalid fncsecshard format: ${yargObj.fncsecshard}. Expected format like "0-0.5"`);
|
|
59
|
+
}
|
|
60
|
+
secondaryShardRange = { startFraction: secondaryStart, endFraction: secondaryEnd };
|
|
61
|
+
console.log(green(`Sharding from ${shardStart} to ${shardEnd}. Fallback sharding (dead function recovery) from ${secondaryStart} to ${secondaryEnd}`));
|
|
62
|
+
} else {
|
|
63
|
+
console.log(green(`Sharding from ${shardStart} to ${shardEnd}`));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
let filterSelector = parseFilterSelector(yargObj.filter);
|
|
67
|
+
|
|
68
|
+
new PathFunctionRunner({
|
|
69
|
+
domainName: getDomain(),
|
|
70
|
+
shardRange: { startFraction: shardStart, endFraction: shardEnd },
|
|
71
|
+
secondaryShardRange,
|
|
72
|
+
// TODO: Maybe abstract this out even more, so anything can plug in permissions checks?
|
|
73
|
+
PermissionsChecker: PermissionsCheck,
|
|
74
|
+
filterSelector,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
if (!isPublic()) {
|
|
78
|
+
// We have to import deploy, otherwise local moduleIds won't be known about
|
|
79
|
+
let deployPath = path.resolve("./deploy.ts");
|
|
80
|
+
await import(deployPath);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (yargObj.filter) {
|
|
84
|
+
console.log(magenta(`Only running functions that match the filter: ${yargObj.filter}. Either use --fncfilter dev in your http server to can calls here, or use ?setfncfilter=${yargObj.filter} in the browser to trigger functions that match this filter.`));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
logErrors(main());
|