Hi Michal, Thank you for such a quick answer, and please excuse the long delay in replying.
First of all thank you for the small configuration piece that you've sent (there was a small error in it but, we have fixed it). However this seems not to be working as expected. Pending changes aren't committed by this task. They are committed after one hour (as component configuration states), not every 2 minutes. You will ask: how do we check this? We have a component with "max age" set to 1h, we make some changes to strings in it and observer project repository maintenance page. Even if we set "max age" to 0h it's still not working. As, previously mentioned, we are using an older Weblate (3.2-1), no the latest one, so we have even manually runned celery using latest command /usr/local/bin/celery worker --app weblate --loglevel info --beat --uid weblate --gid weblate (that we found here https://github.com/WeblateOrg/docker/commit/df31123d7daf5fcae2907e2484298b25ba003635) We can see that a task is runned every 2 minutes [2018-10-31 07:52:26,252: INFO/Beat] Scheduler: Sending due task commit (weblate.trans.tasks.commit_pending) [2018-10-31 07:52:26,256: INFO/MainProcess] Received task: weblate.trans.tasks.commit_pending[82641a00-2e9f-4dc1-b73a-def06107a39a] However this seems not to lead to expected result, as changes aren't committed, and are still pending. The only way for us to commit changes from shell perspective is to run inside weblate container "weblate commitgit --all", and this gives us the expected result Running "weblate commit_pending --all" gives only python warnings: Committing TestProject/TestComponent - Austrian German Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x7f55b6b5cea0> Traceback (most recent call last): File "/usr/lib/python3.5/weakref.py", line 117, in remove TypeError: 'NoneType' object is not callable Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x7f55b6b5cea0> Traceback (most recent call last): File "/usr/lib/python3.5/weakref.py", line 117, in remove TypeError: 'NoneType' object is not callable Running "weblate commit_pending --all --age 0" gives even more errors ;) ERROR Handled exception UnboundLocalError: b"local variable 'age' referenced before assignment" Traceback (most recent call last): File "/usr/local/bin/weblate", line 11, in <module> sys.exit(main()) File "/usr/local/lib/python3.5/dist-packages/weblate/runner.py", line 34, in main execute_from_command_line(argv) File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 381, in execute_from_command_line utility.execute() File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 316, in run_from_argv self.execute(*args, **cmd_options) File "/usr/local/lib/python3.5/dist-packages/weblate/trans/management/commands/__init__.py", line 42, in execute super(WeblateCommand, self).execute(*args, **options) File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 353, in execute output = self.handle(*args, **options) File "/usr/local/lib/python3.5/dist-packages/weblate/trans/management/commands/commit_pending.py", line 45, in handle self.stdout.write if int(options['verbosity']) >= 1 else None, File "/usr/local/lib/python3.5/dist-packages/celery/local.py", line 191, in __call__ return self._get_current_object()(*a, **kw) File "/usr/local/lib/python3.5/dist-packages/celery/app/task.py", line 375, in __call__ return self.run(*args, **kwargs) File "/usr/local/lib/python3.5/dist-packages/weblate/trans/tasks.py", line 93, in commit_pending if last_change > age: UnboundLocalError: local variable 'age' referenced before assignment Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x7f106e458ea0> Traceback (most recent call last): File "/usr/lib/python3.5/weakref.py", line 117, in remove TypeError: 'NoneType' object is not callable Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x7f106e458ea0> Traceback (most recent call last): File "/usr/lib/python3.5/weakref.py", line 117, in remove TypeError: 'NoneType' object is not callable When it comes to your question why we aren't using newer version. So in our tests version 3.2.1-1 and 3.2.1-2 were producing a lot of ignored exceptions similar to this one: Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x7f55b6b5cea0> Traceback (most recent call last): File "/usr/lib/python3.5/weakref.py", line 117, in remove TypeError: 'NoneType' object is not callable Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x7f55b6b5cea0> Traceback (most recent call last): File "/usr/lib/python3.5/weakref.py", line 117, in remove TypeError: 'NoneType' object is not callable and we had some problems with migrations, however from current perspective this (falling migrations) were our fault, and we will give them a try one more time. Versions: 3.2.2+ produced a lot of internal server errors during simple clicking, and one especially huge problem for is the fact that language management stopped working giving error: list index out of range Request Method: POST Request URL: http://localhost/admin/lang/language/add/ Django Version: 2.1.2 Exception Type: IndexError Exception Value: list index out of range Exception Location: /usr/local/lib/python3.5/dist-packages/django/db/models/query.py in __getitem__, line 303 Python Executable: /usr/bin/uwsgi-core Python Version: 3.5.3 Python Path: ['/usr/local/lib/python3.5/dist-packages/', '.', '', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages', '/'] And this is the most commonly occurring error - we were receiving a lot of similar errors randomly while simply clicking around weblate and weblate admin, especially around "languages", "sites" and "components" - so we decided to wait for newer versions as for us the main goal is high accessibility and performance and. With 3.2.2 branch we were unable to even perform configuration of a fresh docker weblate instance so we said "wait". Pozdrawiam / Kind regards, [Employee photo] Łukasz "Max" Kokoszka Senior Software Developer SKYPE: [email protected]<mailto:[email protected]> LINKEDIN: http://www.linkedin.com/in/lukaszmaxkokoszka/ [Future Processing]<http://www.future-processing.com> +48 32 461 23 00<tel:> www.future-processing.com<http://www.future-processing.com> ul. Bojkowska 37A, 44-100 Gliwice, Poland On 10/26/18 2:21 PM, Michal Čihař wrote: Hello On Fri, 2018-10-26 at 11:27 +0000, Łukasz Kokoszka via Weblate wrote: We have a self-hosted Weblate 3.2-1 instance using Docker images (any newer versions are highly-unstable). What kind of unstability do you see? I'm using 3.2.2-2 on several servers and it seems to work just fine. We have a problem with configuring weblate to fit our needs, which is: how to setup Celery to commit all pending changes every 2 minutes? For us the min. possible value of 1h delay in committing is unacceptable. In older Weblates we were setting LAZY_COMMITS to False simply. I think following configuration should do that (untested): CELERY_BEAT_SCHEDULE = { 'commit': { 'task': 'weblate.trans.tasks.commit_pending', 'kwargs' {'hours': 0}, 'schedule': 120, } } You can place it into configuration override: https://docs.weblate.org/en/latest/admin/deployments.html#further-configuration-customization _______________________________________________ Weblate mailing list [email protected]<mailto:[email protected]> https://lists.cihar.com/cgi-bin/mailman/listinfo/weblate
_______________________________________________ Weblate mailing list [email protected] https://lists.cihar.com/cgi-bin/mailman/listinfo/weblate
