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

a qn about synchronize features #375

Open
phanirithvij opened this issue Nov 12, 2024 · 1 comment
Open

a qn about synchronize features #375

phanirithvij opened this issue Nov 12, 2024 · 1 comment

Comments

@phanirithvij
Copy link
Contributor

phanirithvij commented Nov 12, 2024

func syncReposFromFS () {
  gists, err := db.GetAllGistsRows()
  for range gists {
    // if repository does not exist, delete gist from database
    if _, err := os.Stat(git.RepositoryPath(gist.User.Username, gist.Uuid)); err != nil && !os.IsExist(err) {
      if err2 := gist.Delete(); {}
    }
  }

I read this as cleanup unknown gists in db

But synchronize gists from filesystem means the following ideally.

I clone a github gist for eg. in opengist-home/repos/{user}/{gistid} as a bare repo, then synchronize should add it to db. (i.e. the index and import feature on the backend as supposted to from the UI #208)

similarly sync from db is actually cleanup unknown gists in filesystem

@thomiceli
Copy link
Owner

You're right, it's not really a good semantic atm. We should change something like cleanup unknown gists in filesystem

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

No branches or pull requests

2 participants