adding note fix sync too long
This commit is contained in:
parent
1ac457b38a
commit
5261ec8fc1
|
|
@ -17,6 +17,10 @@ export const _ = {
|
|||
|
||||
if (validate(site_id)) {
|
||||
const mode = is_msgpack ? "binary" : "string";
|
||||
const public_data = readDirectoryRecursively(
|
||||
mode,
|
||||
code.path(site_id, "site", "src", "public")
|
||||
);
|
||||
const result = {
|
||||
layouts: await _db.page.findMany({
|
||||
where: {
|
||||
|
|
@ -56,10 +60,7 @@ export const _ = {
|
|||
},
|
||||
select: { id: true, content_tree: true },
|
||||
}),
|
||||
public: readDirectoryRecursively(
|
||||
mode,
|
||||
code.path(site_id, "site", "src", "public")
|
||||
),
|
||||
public: public_data,
|
||||
site: await _db.site.findFirst({
|
||||
where: { id: site_id },
|
||||
select: {
|
||||
|
|
@ -82,6 +83,7 @@ export const _ = {
|
|||
core: readDirectoryRecursively(mode, dir.path(`/app/srv/core`)),
|
||||
},
|
||||
};
|
||||
console.log(public_data);
|
||||
|
||||
return await gzipAsync(
|
||||
mode === "binary" ? encode(result) : JSON.stringify(result)
|
||||
|
|
|
|||
|
|
@ -261,6 +261,12 @@ const doAction = async <T>(arg: {
|
|||
resolve,
|
||||
timeout: path.startsWith("yjs.")
|
||||
? setTimeout(() => {
|
||||
console.error(`Sync too long: `, {
|
||||
type: SyncType.Action,
|
||||
code,
|
||||
args,
|
||||
argid,
|
||||
});
|
||||
w.sync_too_long = true;
|
||||
}, 10000)
|
||||
: undefined,
|
||||
|
|
|
|||
Loading…
Reference in New Issue