How to change the interval or schedule of the DVCS repositories sync

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

このページの内容は、アトラシアン サポートの提供内容ではサポートされないデータベース更新に関連します。このため、アトラシアンでこの内容についてのサポートの提供を保証することはできません。この資料は情報提供のみを目的として提供されています。内容はお客様自身の責任でご利用ください。

目的

The DVCS sync of repositories from GitHub/Bitbucket serves as a fallback mechanism if the webhooks installed on the repository side fail to run for any reason.

By default, the sync is run every hour. This article outlines the steps needed to update the sync interval. 

ソリューション

We need to add an argument to the JVM arguments on startup to set the dvcs.connector.scheduler.interval property in milliseconds.
For example, if we wish to run the scheduled sync daily:

-Ddvcs.connector.scheduler.interval=86400000

(info) Only one node needs to be restarted for this configuration to be applied.

To completely avoid a restart, we can update the sync interval which is stored in milliseconds in the clusteredjob table in the database. You need to update the row that belongs to the DVCS sync job. 

For example, to update the sync interval to a day:

UPDATE clusteredjob
SET interval_millis=86400000 
WHERE job_runner_key='com.atlassian.jira.plugins.dvcs.scheduler.DvcsScheduler';
重要な注意事項
  • The change done by the query will not have an impact on the next run of the sync as this is defined by the value in the next_run column.
  • Jira does not need to be restarted; 
  • The next run of the sync will read the new value of the interval and schedule the subsequent sync accordingly;
  • After a Jira restart, the interval will return to the default value of one hour if the JVM argument is not set; 
  • In order to decide when the next sync will run, you need to: 
    1. Update the next_run column of the job with the epoch conversion of the time. For instance, the query below will set the next run time to Sunday, December 16, 2018 1:00:00 PM GMT:

      UPDATE
      clusteredjob
      SET next_run= 1544965200000
      WHERE job_runner_key='com.atlassian.jira.plugins.dvcs.scheduler.DvcsScheduler';
    2. Jira を再起動します。


You will still need to set the next run job to something in the future, as this will only set the interval value, Changing the system property after the job has been scheduled does not have any effect so we read it once and use that value throughout the lifetime of the plugin.



説明 Change the interval or the schedule of the DVCS sync
製品Jira

最終更新日 2023 年 4 月 18 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.