返回介绍

3.8.14. Masters connector

发布于 2023-09-20 23:50:40 字数 3596 浏览 0 评论 0 收藏 0

Caution

Buildbot no longer supports Python 2.7 on the Buildbot master.

3.8.14. Masters connector

class buildbot.db.masters.MastersConnectorComponent

This class handles tracking the buildmasters in a multi-master configuration. Masters “check in” periodically. Other masters monitor the last activity times, and mark masters that have not recently checked in as inactive.

Masters are represented by master dictionaries with the following keys:

  • id – the ID of this master

  • name – the name of the master (generally of the form hostname:basedir)

  • active – true if this master is running

  • last_active – time that this master last checked in (a datetime object)

findMasterId(name)
Parameters:

name (unicode) – name of this master

Returns:

master id via Deferred

Return the master ID for the master with this master name (generally hostname:basedir). If such a master is already in the database, this returns the ID. If not, the master is added to the database, with active=False, and its ID returned.

setMasterState(masterid, active)
Parameters:
  • masterid (integer) – the master to check in

  • active (boolean) – whether to mark this master as active or inactive

Returns:

boolean via Deferred

Mark the given master as active or inactive, returning true if the state actually changed. If active is true, the last_active time is updated to the current time. If active is false, then any links to this master, such as schedulers, will be deleted.

getMaster(masterid)
Parameters:

masterid (integer) – the master to check in

Returns:

Master dict or None via Deferred

Get the indicated master.

getMasters()
Returns:

list of Master dicts via Deferred

Get a list of the masters, represented as dictionaries; masters are sorted and paged using generic data query options

setAllMastersActiveLongTimeAgo()
Returns:

None via Deferred

This method is intended to be called by upgrade-master, and will effectively force housekeeping on all masters at next startup. This method is not intended to be called outside of housekeeping scripts.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文