weblate icon indicating copy to clipboard operation
weblate copied to clipboard

Let Lazy Commits ignore API requests

Open xoxfaby opened this issue 1 year ago • 3 comments

Describe the problem

I'd love to utilize lazy commits to limit the amount of commits and how often changes have to be pushed upstream. The problem is, I use the API to let my app pull the latest translations on startup, resulting in API calls all the time, which triggers a commit, which renders lazy commits useless.

Describe the solution you would like

So I'd like to be able to either let the lazy commit logic ignore API calls or maybe allow commits to be pushed every hour?

Describe alternatives you have considered

My current alternative is that I added a custom task to push commits every hour, which limits how often the remote repo has to update, but it's obviously not ideal to have to do this and also it still leaves me with many commits.

Screenshots

No response

Additional context

No response

xoxfaby avatar Mar 23 '24 12:03 xoxfaby

The only API operation which triggers commit is download (as documented at https://docs.weblate.org/en/latest/admin/continuous.html#lazy-commits). That is because Weblate needs to flush the changes from the database to the file, and a that point it commits it to the repository as well.

What probably could be added to the download API is a parameter that would download the currently present file instead of flushing pending changes by committing.

nijel avatar Mar 23 '24 13:03 nijel

Yeah, that is the one endpoint I use. Since I need all the strings, I just download them if the file has changed. Would definitely love if this solution was an option, I could definitely use that.

xoxfaby avatar Mar 23 '24 14:03 xoxfaby

This issue has been put aside. It is currently unclear if it will ever be implemented as it seems to cover too narrow of a use case or doesn't seem to fit into Weblate.

Please try to clarify the use case or consider proposing something more generic to make it useful to more users.

github-actions[bot] avatar Mar 24 '24 11:03 github-actions[bot]