Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline Object Loader #3717

Merged
merged 17 commits into from
Dec 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed unused functions from objectloader
AlexandruPopovici committed Dec 18, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
midwan Dimitris Panokostas
commit 985d8aa0509e9f438ff7715f4b178f69b44030a7
44 changes: 0 additions & 44 deletions packages/objectloader/src/index.js
Original file line number Diff line number Diff line change
@@ -375,18 +375,6 @@ class ObjectLoader {
this.logger(`Loaded ${count} objects in: ${(Date.now() - t0) / 1000}`)
}

async *getObjectIterator2(input) {
const data = JSON.parse(input)
const t0 = Date.now()
let count = 0
for await (const { id, obj } of this.getRawObjectIterator2(data)) {
this.buffer[id] = obj
count += 1
yield obj
}
this.logger(`Loaded ${count} objects in: ${(Date.now() - t0) / 1000}`)
}

processLine(chunk) {
const pieces = chunk.split('\t')
const [id, unparsedObj] = pieces
@@ -419,38 +407,6 @@ class ObjectLoader {
this.cacheDB = await this.promisifyIdbRequest(idbOpenRequest)
}

async *getRawObjectIterator2(data) {
await this.setupCacheDb()

// const rootObjJson = await this.getRawRootObject()
// // this.logger("Root in: ", Date.now() - tSTART)

yield { id: data[0].id, obj: data[0] }

const rootObj = data[0]
if (!rootObj.__closure) return

// const childrenIds = Object.keys(rootObj.__closure)
// .filter((id) => !id.includes('blob'))
// .sort((a, b) => rootObj.__closure[a] - rootObj.__closure[b])

// for (const id of childrenIds) {
// const obj = data.find((value) => value.id === id)
// // Sleep 1 ms
// await new Promise((resolve) => {
// setTimeout(resolve, 1)
// })
// yield { id, obj }
// }
for (const item of data) {
// Sleep 1 ms
await new Promise((resolve) => {
setTimeout(resolve, 1)
})
yield { id: item.id, obj: item }
}
}

async *getRawObjectIterator() {
await this.setupCacheDb()

1 change: 0 additions & 1 deletion packages/objectloader/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -49,7 +49,6 @@ class ObjectLoader {
): SpeckleObject | SpeckleObject[]

async *getObjectIterator(): Generator<SpeckleObject, SpeckleObject>
async *getObjectIterator2(input: string): Generator<SpeckleObject, SpeckleObject>
async getObject(id: string): Promise<Record<string, unknown>>
dispose(): void
}

Unchanged files with check annotations Beta

# google-chrome-stable is only available for amd64 so we have to fix the platform
# hadolint ignore=DL3029
FROM --platform=linux/amd64 node:18-bookworm-slim@sha256:408f8cbbb7b33a5bb94bdb8862795a94d2b64c2d516856824fd86c4a5594a443 AS node

Check warning on line 41 in packages/preview-service/Dockerfile

GitHub Actions / Build Preview Service

FROM --platform flag should not use a constant value

FromPlatformFlagConstDisallowed: FROM --platform flag should not use constant value "linux/amd64" More info: https://docs.docker.com/go/dockerfile/rule/from-platform-flag-const-disallowed/
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install tini and fonts