Skip to content
This repository has been archived by the owner on Aug 9, 2020. It is now read-only.

Perf: Do not change temporary folders of git sources #167

Open
ptbrowne opened this issue Dec 28, 2018 · 1 comment
Open

Perf: Do not change temporary folders of git sources #167

ptbrowne opened this issue Dec 28, 2018 · 1 comment

Comments

@ptbrowne
Copy link

ptbrowne commented Dec 28, 2018

When running gitdocs serve with many sources from git repositories, the git repositories are not conserved, and are re-fetched which can be a problem for large git repositories. Would you consider keeping the temporary repositories ? I could make a PR :)

@ptbrowne
Copy link
Author

ptbrowne commented Dec 28, 2018

At the moment I quickly and dirtily patched gitdocs :

In src/sources/git.js

function tempDir () {
  // tmp.setGracefulCleanup()

  // const dir = tmp.dirSync({
  //   prefix: 'gitdocs-',
  // })

  return '/tmp/gitdocs/'

It is not working yet since when starting, gitdocs seems to be removing all temporary folders. I am still searching where it does that.

In src/utils/config.js

  // await fs.emptyDir(masterConfig.temp)

I think there should be an option to

  • bypass the cleaning of the temporary directory
  • keep the git clones even after the server has been closed

It is an important perf improvement for me as the server otherwise starts in more than 3 minutes vs 10s if the temporary directory is not emptied.

What do you think ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant