Skip to content

Conversation

radoslavius
Copy link

I do not know if it was the intention, but this behavior seems to me better. Especially if there is a large number of cached files.

@radoslavius radoslavius changed the title Create subdirs when using the method derive FileStorage: Create subdirs when using the method derive Oct 21, 2015
Copy link
Member

Choose a reason for hiding this comment

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

This is not thread safe.

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@milo What problem it can cause?

Copy link
Member

Choose a reason for hiding this comment

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

@dg Let's say only a dir/ exists and 1st thread is creating dir/aaa/bbb/ and 2nd dir/aaa/ccc/. When they start in the same time, 1st creates dir/aaa/ and 2nd tries too. 1st is success and continues to create dir/aaa/bbb/ but 2nd fails and ends, so dir/aaa/ccc/ does not exist.

Copy link
Member

Choose a reason for hiding this comment

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

I recalled nette/nette@0e23c0a

Copy link
Member

Choose a reason for hiding this comment

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

@milo thanx!

Btw, FileStorage is using only one level of directories, isn't it? So this PR is not needed.

Copy link
Member

Choose a reason for hiding this comment

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

@dg Imho, purpose is that $cache->derive('a')->derive('b')->derive('c')->save('key', 'val'); will create tmp/_a/_b/_c, now it creates tmp/_%00a%00b%00c.

Copy link
Member

Choose a reason for hiding this comment

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

Now I see!

@dg dg force-pushed the master branch 3 times, most recently from 2f8f6fb to 8c9cca3 Compare April 21, 2016 13:13
@dg dg force-pushed the master branch 6 times, most recently from 0aed862 to a0c400e Compare May 2, 2016 20:25
@dg dg force-pushed the master branch 3 times, most recently from 54c618b to 62a27d9 Compare May 19, 2016 00:29
@dg dg force-pushed the master branch 2 times, most recently from ec9e432 to e07955b Compare June 14, 2016 14:24
@dg dg force-pushed the master branch 3 times, most recently from 492413c to b0b475e Compare January 9, 2017 20:11
@dg dg force-pushed the master branch 4 times, most recently from 6037e83 to 1fe69cc Compare January 13, 2017 07:34
@dg dg force-pushed the master branch 4 times, most recently from 6df4f89 to 30051c1 Compare January 23, 2017 21:34
@dg dg force-pushed the master branch 5 times, most recently from 2f60360 to 93f335f Compare January 21, 2023 19:59
@dg dg force-pushed the master branch 2 times, most recently from 41b5503 to 327c2bf Compare September 26, 2023 11:12
@dg dg force-pushed the master branch 2 times, most recently from 3982670 to d89af84 Compare December 5, 2023 21:32
@dg dg force-pushed the master branch 2 times, most recently from 40be743 to a116cb9 Compare March 10, 2024 22:09
@dg dg force-pushed the master branch 2 times, most recently from ea335de to ccec70b Compare June 18, 2024 22:13
@dg dg force-pushed the master branch 3 times, most recently from 3ce492d to fb5c89d Compare August 13, 2024 20:20
@dg dg force-pushed the master branch 3 times, most recently from d31ad07 to a71faf1 Compare June 5, 2025 23:25
@dg dg force-pushed the master branch 2 times, most recently from 2d5f7a5 to 91c8061 Compare June 19, 2025 16:58
@dg dg force-pushed the master branch 3 times, most recently from b91fc47 to 05451a0 Compare August 6, 2025 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants