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

MarkdownDB fails with more than 500 files in a top directory #22

Closed
luccasmmg opened this issue May 31, 2023 · 8 comments
Closed

MarkdownDB fails with more than 500 files in a top directory #22

luccasmmg opened this issue May 31, 2023 · 8 comments
Assignees

Comments

@luccasmmg
Copy link
Member

Steps to reproduce

Try indexing this in markdowndb, this is the outcome
image

I've also tried indexing this directory on a fresh flowershow app, following this guide https://flowershow.app/docs/publish-tutorial and on the export section it will silently fail, but it will build again if i remove that dir

Possible problem

I'm pretty sure the problem lies somewhere here, from what i could gather in stackoverflow, sqlite has a limit on the batch insert of 500, so a possible fix would be to slice the filesToInsert variable in batches of 499 and then insert each batch separatedly.
https://github.com/datopian/markdowndb/blob/main/src/lib/markdowndb.ts#LL181C4-L181C4

@rufuspollock
Copy link
Member

rufuspollock commented Jun 1, 2023

@luccasmmg good find. do you think you could look at doing this patch? Maybe with some pointers from @olayway

@olayway
Copy link
Member

olayway commented Jun 2, 2023

@luccasmmg that's a good catch! This definitely needs to be solved for the first indexing run but this reminded me that we could also probably use some way to not re-index the whole content folder each time the server is restarted, although I'm not yet sure how this could be done. Anyway, I'll take care of it. Thanks for the proposed solution!

@olayway olayway self-assigned this Jun 2, 2023
@rufuspollock
Copy link
Member

@olayway this is probably pretty urgent as it will break all flowershow sites over 500 files right ...?

@camargomau camargomau mentioned this issue Jun 5, 2023
olayway pushed a commit that referenced this issue Jun 9, 2023
@olayway olayway closed this as completed Jun 9, 2023
@dstengle
Copy link
Contributor

It looks like this fix got lost somewhere along the way. Possible to bring it back? I can't quite figure out where it went.

@dstengle
Copy link
Contributor

Found it: f6fe5b0

Looks like things got moved around here and now there is both duplicate and missing code?

@rufuspollock
Copy link
Member

@mohamedsalem401 can you look at this asap ... is this now broken or is it fixed.

@rufuspollock rufuspollock reopened this Dec 18, 2023
@mohamedsalem401
Copy link
Contributor

@dstengle @rufuspollock
You are right, the fix needs to be re-added.

@mohamedsalem401
Copy link
Contributor

This is fixed

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

No branches or pull requests

5 participants