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

chore: update snapshots fetcher #254

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
78 changes: 78 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
"semi": false
},
"dependencies": {
"@dcl/catalyst-storage": "^2.0.3",
"@dcl/schemas": "^6.6.0",
"@dcl/catalyst-storage": "^2.0.3",
"@dcl/snapshots-fetcher": "^5.0.4",
"@types/destroy": "^1.0.0",
"@well-known-components/env-config-provider": "^1.1.1",
"@well-known-components/http-server": "^1.1.1",
"@well-known-components/interfaces": "^1.1.1",
"@well-known-components/logger": "^3.0.0",
"@well-known-components/metrics": "^2.0.1",
"aws-sdk": "^2.1138.0"
}
}
}
10 changes: 8 additions & 2 deletions src/adapters/deployer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { downloadEntityAndContentFiles } from "@dcl/snapshots-fetcher"
import { IDeployerComponent } from "@dcl/snapshots-fetcher/dist/types"
import { SNS } from "aws-sdk"
import { AppComponents } from "../../types"
import { DeploymentToSqs } from "@dcl/schemas/dist/misc/deployments-to-sqs";
import { DeploymentToSqs } from "@dcl/schemas/dist/misc/deployments-to-sqs"

export function createDeployerComponent(
components: Pick<AppComponents, "logs" | "storage" | "downloadQueue" | "fetch" | "metrics" | "sns">
Expand All @@ -13,6 +13,7 @@ export function createDeployerComponent(

return {
async deployEntity(entity, servers) {
const markAsDeployed = entity.markAsDeployed ? entity.markAsDeployed : async () => { }
if (entity.entityType == "scene" || entity.entityType == "wearable" || entity.entityType == "emote") {
const exists = await components.storage.exist(entity.entityId)

Expand Down Expand Up @@ -51,10 +52,15 @@ export function createDeployerComponent(
SequenceNumber: receipt.SequenceNumber as any,
})
}
await markAsDeployed()
})
} else {
await markAsDeployed()
}
} else {
await markAsDeployed()
}
},
async onIdle() {},
async onIdle() { },
}
}
2 changes: 2 additions & 0 deletions src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,7 @@ export async function initComponents(): Promise<AppComponents> {
synchronizer,
deployer,
sns,
processedSnapshotStorage,
snapshotStorage
}
}
19 changes: 12 additions & 7 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { IJobQueue } from "@dcl/snapshots-fetcher/dist/job-queue-port"
import { IDeployerComponent, SynchronizerComponent } from "@dcl/snapshots-fetcher/dist/types"
import { IDeployerComponent, IProcessedSnapshotStorageComponent, ISnapshotStorageComponent, SynchronizerComponent } from "@dcl/snapshots-fetcher/dist/types"

import type { IFetchComponent } from "@well-known-components/http-server"
import type {
IConfigComponent,
Expand All @@ -26,6 +27,10 @@ export type BaseComponents = {
fs: IFileSystemComponent
storage: IContentStorageComponent
synchronizer: SynchronizerComponent

processedSnapshotStorage: IProcessedSnapshotStorageComponent
snapshotStorage: ISnapshotStorageComponent

deployer: IDeployerComponent
sns: SnsComponent
}
Expand All @@ -47,11 +52,11 @@ export type TestComponents = BaseComponents & {
export type HandlerContextWithPath<
ComponentNames extends keyof AppComponents,
Path extends string = any
> = IHttpServerComponent.PathAwareContext<
IHttpServerComponent.DefaultContext<{
components: Pick<AppComponents, ComponentNames>
}>,
Path
>
> = IHttpServerComponent.PathAwareContext<
IHttpServerComponent.DefaultContext<{
components: Pick<AppComponents, ComponentNames>
}>,
Path
>

export type Context<Path extends string = any> = IHttpServerComponent.PathAwareContext<GlobalContext, Path>