Skip to content

feat!: multi tile storage destinations including fs#30

Merged
syncush merged 37 commits intomasterfrom
multi-tile-storage
Nov 24, 2023
Merged

feat!: multi tile storage destinations including fs#30
syncush merged 37 commits intomasterfrom
multi-tile-storage

Conversation

@melancholiai
Copy link
Copy Markdown
Contributor

Question Answer
Bug fix
New feature
Breaking change
Deprecations
Documentation
Tests added
Chore

@melancholiai melancholiai requested a review from syncush November 14, 2023 13:28
}
"providers": {
"__name": "TILES_STORAGE_PROVIDERS",
"__format": "json"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't validate its schema right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added ajv on the factory function

Comment thread src/index.ts
});
cleanupRegistry.register({
func: async () => {
return new Promise((resolve) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt we use server.drain also ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no such function


private readonly jobFinishedEmitter = new EventEmitter();
private readonly jobFinishedEventName = 'avi';
private readonly jobFinishedEventName = 'jobFinished';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unacceptable!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry ;(

func: async () => {
return new Promise((resolve) => {
(s3Client as S3Client).destroy();
resolve(undefined);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it better to return resolve(undefined);?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Comment on lines +29 to +31
if (!existsSync(dir)) {
await mkdir(dir, { recursive: true });
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we make a dir on our own ? what about permissions and so on, I think the server should fail if path does not exists or is not writeable or readable. we should not change the state of the storage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tiles storage dir is set according to the fs storageProvider's basePath + app.tilesStorage.layout.format configuration value, the latter value changes from time to time.
I don't see a downside to attempt to create the dir, remember it also creates the z/x/y directories.
another manual step is another pain in the ass, and anyway if there are insufficient permissions to write the file the job will fail with a proper error.

functions: 80,
lines: 80,
statements: -10,
statements: -20,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have a reason to lower the standard?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, I've added a couple of tests to achieve the standard

@melancholiai melancholiai requested a review from syncush November 19, 2023 09:16
@syncush syncush merged commit b2e3126 into master Nov 24, 2023
@melancholiai melancholiai deleted the multi-tile-storage branch November 28, 2023 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants