openlawlibrary / OLAAF-Transient

Transient authentication implementation
Other
3 stars 0 forks source link

Constantly calling git show causes memory issues #8

Open renatav opened 5 years ago

renatav commented 5 years ago
 File "manage.py", line 19, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/portal/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/opt/portal/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/portal/venv/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/portal/venv/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
    output = self.handle(*args, **options)
  File "/opt/portal/venv/lib/python3.6/site-packages/olaaf_django/management/commands/synchashes.py", line 13, in handle
    sync_hashes(repo_path)
  File "/opt/portal/venv/lib/python3.6/site-packages/olaaf_django/sync_hashes.py", line 81, in sync_hashes
    _insert_diff_hashes(edition, repo, prev_commit, current_commit)
  File "/opt/portal/venv/lib/python3.6/site-packages/olaaf_django/sync_hashes.py", line 144, in _insert_diff_hashes
    posix_path, file_type)
  File "/opt/portal/venv/lib/python3.6/site-packages/olaaf_django/sync_hashes.py", line 312, in _get_file_content_and_document
    file_content = repo.git.show('{}:{}'.format(commit_sha, file_path))
  File "/opt/portal/venv/lib/python3.6/site-packages/git/cmd.py", line 545, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "/opt/portal/venv/lib/python3.6/site-packages/git/cmd.py", line 1014, in _call_process
    return self.execute(call, **exec_kwargs)
  File "/opt/portal/venv/lib/python3.6/site-packages/git/cmd.py", line 735, in execute
    **subprocess_kwargs
  File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1295, in _execute_child
    restore_signals, start_new_session, preexec_fn)
OSError: [Errno 12] Cannot allocate memory

Is there a way to stream git show?