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

Refresh cached directory listing only after timeout. #147

Open
Tracked by #148
fangfufu opened this issue May 11, 2024 · 1 comment
Open
Tracked by #148

Refresh cached directory listing only after timeout. #147

fangfufu opened this issue May 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@fangfufu
Copy link
Owner

fangfufu commented May 11, 2024

Currently the LinkTable is pulled in regardless if it is timed out:

httpdirfs/src/link.c

Lines 603 to 633 in 9e383ad

disk_linktbl = LinkTable_disk_open(unescaped_path);
if (disk_linktbl) {
/*
* Check if the LinkTable needs to be refreshed based on timeout.
*/
time_t time_now = time(NULL);
if (time_now - disk_linktbl->index_time > CONFIG.refresh_timeout) {
lprintf(info, "time_now: %d, index_time: %d\n", time_now,
disk_linktbl->index_time);
lprintf(info, "diff: %d, limit: %d\n",
time_now - disk_linktbl->index_time,
CONFIG.refresh_timeout);
LinkTable_free(disk_linktbl);
}
/*
* Check if there are inconsistencies for the on-disk LinkTable
*/
if (disk_linktbl->num == linktbl->num) {
LinkTable_free(linktbl);
linktbl = disk_linktbl;
skip_fill = 1;
} else {
lprintf(info,
"disk_linktbl->num: %d, linktbl->num: %d\n",
disk_linktbl->num, linktbl->num);
lprintf(info, "Refreshing LinkTable for %s\n",
url + ROOT_LINK_OFFSET);
LinkTable_free(disk_linktbl);
}
}

This should be modified so the LinkTable is pulled in only after timeout.

@fangfufu fangfufu added the bug Something isn't working label May 11, 2024
@fangfufu fangfufu mentioned this issue May 11, 2024
13 tasks
@fangfufu
Copy link
Owner Author

fangfufu commented May 11, 2024

The LinkTable's cache invalidation is fixed by f5ed128

I need to consider the invalidation of the files, and whether or not to incorporate the previous smart invalidation strategy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant