首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何通过ssh强制rhodecode在推送后使缓存失效

如何通过ssh强制rhodecode在推送后使缓存失效
EN

Stack Overflow用户
提问于 2013-01-08 08:50:17
回答 1查看 868关注 0票数 2

我正在运行一个用于代码评审等的rhodecode实例,但是当我通过ssh进行推送时,它不会看到更改集(除非我从hgweb手动拉动)。

我是否需要一个进入的钩子在汞或什么东西,以使铑解码正常工作?

编辑

通过添加钩子incoming.rhodecode = python:rhodecode.lib.hooks.log_push_action,我得到了堆栈跟踪:

代码语言:javascript
复制
remote:   File "/usr/share/mercurial-server/hg-ssh", line 91, in <module>
remote:     dispatch.dispatch(request(['-R', repo, 'serve', '--stdio']))
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 65, in dispatch
remote:     return _runcatch(req)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 88, in _runcatch
remote:     return _dispatch(req)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 741, in _dispatch
remote:     cmdpats, cmdoptions)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 514, in runcommand
remote:     ret = _runcommand(ui, options, cmd, d)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 831, in _runcommand
remote:     return checkargs()
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 802, in checkargs
remote:     return cmdfunc()
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 738, in <lambda>
remote:     d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/util.py", line 472, in check
remote:     return func(*args, **kwargs)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/commands.py", line 5211, in serve
remote:     s.serve_forever()
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/sshserver.py", line 94, in serve_forever
remote:     while self.serve_one():
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/sshserver.py", line 112, in serve_one
remote:     rsp = wireproto.dispatch(self.repo, self, cmd)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/wireproto.py", line 351, in dispatch
remote:     return func(repo, proto, *args)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/wireproto.py", line 629, in unbundle
remote:     lock.release()
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/lock.py", line 143, in release
remote:     callback()
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/localrepo.py", line 2452, in runhooks
remote:     source=srctype, url=url)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/localrepo.py", line 386, in hook
remote:     return hook.hook(self.ui, self, name, throw, **args)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/hook.py", line 181, in hook
remote:     r = _pythonhook(ui, repo, name, hname, hookfn, args, throw) or r
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/hook.py", line 38, in _pythonhook
remote:     obj = __import__(modname)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/demandimport.py", line 95, in _demandimport
remote:     return _import(name, globals, locals, fromlist, level)
remote:   File "/usr/local/lib/python2.7/dist-packages/rhodecode/lib/hooks.py", line 35, in <module>
remote:     from rhodecode.lib.utils import action_logger
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/demandimport.py", line 114, in _demandimport
remote:     mod = _origimport(name, globals, locals)
remote:   File "/usr/local/lib/python2.7/dist-packages/rhodecode/lib/utils.py", line 55, in <module>
remote:     from rhodecode.model.db import Repository, User, RhodeCodeUi, \
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/demandimport.py", line 114, in _demandimport
remote:     mod = _origimport(name, globals, locals)
remote:   File "/usr/local/lib/python2.7/dist-packages/rhodecode/model/db.py", line 147, in <module>
remote:     class RhodeCodeSetting(Base, BaseModel):
remote:   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative.py", line 1343, in __init__
remote:     _as_declarative(cls, classname, cls.__dict__)
remote:   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative.py", line 1082, in _as_declarative
remote:     class_mapped = _is_mapped_class(base)
remote:   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/util.py", line 696, in _is_mapped_class
remote:     manager = attributes.manager_of_class(cls)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/demandimport.py", line 87, in __getattribute__
remote:     return getattr(self._module, attr)
remote: AttributeError: 'module' object has no attribute 'manager_of_class'
abort: unexpected response: empty string
EN

回答 1

Stack Overflow用户

发布于 2013-01-08 23:02:28

RhodeCode使用后推送钩子使存储库的缓存失效,并将push/pull事件存储在它的日志中。你可以做一些事情来克服这一点。

  • 禁用vcs_full_cache,并将缓存过期时间调低到某个较低的数字(例如60秒)
  • 在通过SSH时调用适当的RhodeCode挂钩,我认为这是最合适的解决方案
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14211261

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档