File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
src/packages/file-server/conat Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 11import { fsServer } from "@cocalc/conat/files/fs" ;
2- import { conat } from "@cocalc/backend/conat" ;
32import { SandboxedFilesystem } from "@cocalc/file-server/fs/sandbox" ;
43import { mkdir } from "fs/promises" ;
54import { join } from "path" ;
65import { isValidUUID } from "@cocalc/util/misc" ;
6+ import { type Client , getClient } from "@cocalc/conat/core/client" ;
77
88export function localPathFileserver ( {
99 service,
1010 path,
11+ client,
1112} : {
1213 service : string ;
1314 path : string ;
15+ client ?: Client ;
1416} ) {
15- const client = conat ( ) ;
17+ client ??= getClient ( ) ;
1618 const server = fsServer ( {
1719 service,
1820 client,
Original file line number Diff line number Diff line change @@ -4,17 +4,19 @@ import { tmpdir } from "node:os";
44import { join } from "path" ;
55import { fsClient } from "@cocalc/conat/files/fs" ;
66import { randomId } from "@cocalc/conat/names" ;
7+ import { before , after , client } from "@cocalc/backend/conat/test/setup" ;
78
89let tempDir ;
910beforeAll ( async ( ) => {
11+ await before ( ) ;
1012 tempDir = await mkdtemp ( join ( tmpdir ( ) , "cocalc-local-path" ) ) ;
1113} ) ;
1214
1315describe ( "use the simple fileserver" , ( ) => {
1416 const service = `fs-${ randomId ( ) } ` ;
1517 let server ;
1618 it ( "creates the simple fileserver service" , async ( ) => {
17- server = await localPathFileserver ( { service, path : tempDir } ) ;
19+ server = await localPathFileserver ( { client , service, path : tempDir } ) ;
1820 } ) ;
1921
2022 const project_id = "6b851643-360e-435e-b87e-f9a6ab64a8b1" ;
@@ -104,5 +106,6 @@ describe("use the simple fileserver", () => {
104106} ) ;
105107
106108afterAll ( async ( ) => {
109+ await after ( ) ;
107110 await rm ( tempDir , { force : true , recursive : true } ) ;
108111} ) ;
You can’t perform that action at this time.
0 commit comments