Skip to content

feat: move file cache from view to node api#52000

Open
icewind1991 wants to merge 3 commits intomasterfrom
files-cache-node
Open

feat: move file cache from view to node api#52000
icewind1991 wants to merge 3 commits intomasterfrom
files-cache-node

Conversation

@icewind1991
Copy link
Copy Markdown
Member

Also changes the explicit full-filesystem setup to the normal implicit filesystem setup that can do the optimized path of only setting up the home storage.

@icewind1991 icewind1991 added the 3. to review Waiting for reviews label Apr 7, 2025
@icewind1991 icewind1991 added this to the Nextcloud 32 milestone Apr 7, 2025
@icewind1991 icewind1991 requested a review from a team as a code owner April 7, 2025 13:56
@icewind1991 icewind1991 requested review from Altahrim, come-nc and skjnldsv and removed request for a team April 7, 2025 13:56
Copy link
Copy Markdown
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

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

Where is this class used? I can only find it used for registering its garbage collector.

Comment thread lib/private/Cache/File.php
@icewind1991 icewind1991 force-pushed the files-cache-node branch 6 times, most recently from e382471 to c89e3c2 Compare April 7, 2025 17:35
Copy link
Copy Markdown
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

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

Much cleaner!!

This was referenced Aug 22, 2025
This was referenced Sep 2, 2025
This was referenced Sep 25, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
This was referenced Jan 7, 2026
This was referenced Jan 14, 2026
This was referenced Jan 29, 2026
This was referenced Feb 11, 2026
@blizzz blizzz modified the milestones: Nextcloud 33, Nextcloud 34 Feb 16, 2026
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
protected function run(mixed $argument): void {
$offset = $this->appConfig->getValueInt('core', 'files_gc_offset');

$users = $this->userManager->getSeenUsers($offset);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's an int offset and starting over will catch newly added users, so that is not a problem I guess? 🙈

return;
}
}
$this->appConfig->setValueInt('core', 'files_gc_offset', 0);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This however always resets to the start, if the gc for the 1k users in above loop took less then 23h, it will never do page 2+

$now = time();

// almost time for the next job run, stop early and save our location
if ($now - $start > 23 * 60 * 60) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should stop after ~6h if possible so the "maintenance window" is respected.

On the other side if the instance has millions of users, if we only do 1k users per night, this will not scale?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants