Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to disable automatic mirror syncing. #5242

Merged
merged 2 commits into from
Nov 8, 2018

Conversation

cez81
Copy link
Contributor

@cez81 cez81 commented Oct 31, 2018

Setting the interval to 0 will disable to automatic syncing.

Closes #3562

Setting the interval to 0 will disable to automatic syncing.
@codecov-io
Copy link

codecov-io commented Oct 31, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@de8f981). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #5242   +/-   ##
=========================================
  Coverage          ?   37.37%           
=========================================
  Files             ?      312           
  Lines             ?    46322           
  Branches          ?        0           
=========================================
  Hits              ?    17314           
  Misses            ?    26527           
  Partials          ?     2481
Impacted Files Coverage Δ
models/repo_mirror.go 2.57% <0%> (ø)
routers/repo/setting.go 10.97% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de8f981...57128f2. Read the comment docs.

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 31, 2018
@techknowlogick techknowlogick added this to the 1.7.0 milestone Nov 1, 2018
@techknowlogick techknowlogick added the type/enhancement An improvement of existing functionality label Nov 1, 2018
Copy link
Contributor

@zeripath zeripath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm... why not just set the mirror interval to blank to disable automatic sync?

@lafriks
Copy link
Member

lafriks commented Nov 8, 2018

@zeripath because it is number and can not be empty, imho

@bkcsoft bkcsoft added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Nov 8, 2018
@zeripath
Copy link
Contributor

zeripath commented Nov 8, 2018

Ah but it's not a number - It's an interval 😉 . You have units.

By using 0 to mean never you're breaking the semantics of the interval - 0 could easily mean always, once, never. A blank field is clearly not a valid interval. If there are other uses of an essentially nonsense number being used as flag in the UI - it's ok to add another, but it's a very C way doing things.

BTW are there any limits on how often a mirroring can take place, e.g. should we really be able to set this to 1s? (Edit: stupid me of course there's a minimal interval it's even in the diffs)

@lafriks
Copy link
Member

lafriks commented Nov 8, 2018

@zeripath but in the end interval is still converted to number of seconds (golang variable is number so it can not contain anything fancy :) )

@zeripath
Copy link
Contributor

zeripath commented Nov 8, 2018

Ah, I see - using 0 makes the minimal change to the codebase.

Sorry, I was coming at it from a UI view. Exposing the 0 semantics doesn't make for the nicest UI - but it could be improved later with a little switch that says autosynchronize on/off and the interval box - requiring a non-zero value if on.

I'll lgtm this though in the meantime from a point of view that it works, is simple and can be improved later.

@bkcsoft bkcsoft added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Nov 8, 2018
@techknowlogick techknowlogick merged commit 599adde into go-gitea:master Nov 8, 2018
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
@cez81 cez81 deleted the issue_3562 branch May 12, 2021 18:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mirror settings -> interval: -1
6 participants