scragg0x / realms-wiki

Git based wiki inspired by Gollum
http://realms.io
GNU General Public License v2.0
831 stars 90 forks source link

Manual git updates and cache #98

Closed gazpachoking closed 8 years ago

gazpachoking commented 8 years ago

Now that the cache is working for pages, is there some sort of call that would update or invalidate the cache in case the git repo was updated from outside realms? (maybe this is something we could add to commands.py if there isn't currently a way?) I'm thinking of having some sort of 2 way sync to github once I get our realms instance live, such that we could accept PRs in github which get merged into the realms repo.

scragg0x commented 8 years ago

I believe git repos support commit hooks that can run a script. You can run a cli command to invalidate cache. Realms dont have a cmd yet but that should be easy.
With github, a hook to make a request to realms would work.

gazpachoking commented 8 years ago

Yeah, I was thinking a post-merge hook, but then I was wondering if dulwich would also trigger that from realms updates? (EDIT: I guess realms is just doing regular commits, so a merge hook wouldn't be triggered. That does seem like a good place then.) I can fit it into a script one way or another, was just wondering if you agreed a new realms command was the thing to do. I'll look into adding one when I get some time if you don't.

scragg0x commented 8 years ago

I agree, it's a good feature and having a command available is good regardless.