Compare commits
1 Commits
t-split-co
...
env-disabl
| Author | SHA256 | Date | |
|---|---|---|---|
|
|
58f410befc |
@@ -857,12 +857,13 @@ func (gitea *GiteaTransport) ResetTimelineCache(org, repo string, idx int64) {
|
||||
func (gitea *GiteaTransport) GetTimeline(org, repo string, idx int64) ([]*models.TimelineComment, error) {
|
||||
page := int64(1)
|
||||
resCount := 1
|
||||
disableCache := GetEnvOverrideBool(os.Getenv("AUTOGITS_TIMELINE_CACHE_DISABLE"), false)
|
||||
|
||||
prID := fmt.Sprintf("%s/%s!%d", org, repo, idx)
|
||||
giteaTimelineCacheMutex.RLock()
|
||||
TimelineCache, IsCached := giteaTimelineCache[prID]
|
||||
var LastCachedTime strfmt.DateTime
|
||||
if IsCached {
|
||||
if IsCached && !disableCache {
|
||||
l := len(TimelineCache.data)
|
||||
if l > 0 {
|
||||
LastCachedTime = TimelineCache.data[0].Updated
|
||||
@@ -879,6 +880,10 @@ func (gitea *GiteaTransport) GetTimeline(org, repo string, idx int64) ([]*models
|
||||
giteaTimelineCacheMutex.Lock()
|
||||
defer giteaTimelineCacheMutex.Unlock()
|
||||
|
||||
if disableCache {
|
||||
TimelineCache = TimelineCacheData{}
|
||||
}
|
||||
|
||||
for resCount > 0 {
|
||||
opts := issue.NewIssueGetCommentsAndTimelineParams().WithOwner(org).WithRepo(repo).WithIndex(idx).WithPage(&page)
|
||||
if !LastCachedTime.IsZero() {
|
||||
|
||||
@@ -95,6 +95,7 @@ services:
|
||||
- AMQP_USERNAME=gitea
|
||||
- AMQP_PASSWORD=gitea
|
||||
- SSL_CERT_FILE=/usr/share/pki/trust/anchors/gitea-rabbitmq-ca.crt
|
||||
- AUTOGITS_TIMELINE_CACHE_DISABLE=1
|
||||
volumes:
|
||||
- ./gitea-data:/var/lib/gitea:ro,z
|
||||
- ./workflow-pr/workflow-pr.json:/etc/workflow-pr.json:ro,z
|
||||
|
||||
@@ -139,7 +139,6 @@ index 00000000..473a0f4c
|
||||
|
||||
|
||||
@pytest.mark.t005
|
||||
# @pytest.mark.xfail(reason="TBD troubleshoot")
|
||||
def test_005_any_maintainer_approval_sufficient(maintainer_env, ownerA_client, ownerBB_client):
|
||||
"""
|
||||
Test scenario:
|
||||
@@ -201,7 +200,6 @@ index 00000000..473a0f4c
|
||||
|
||||
|
||||
@pytest.mark.t006
|
||||
@pytest.mark.xfail(reason="tbd flacky in ci")
|
||||
def test_006_maintainer_rejection_removes_other_requests(maintainer_env, ownerA_client, ownerBB_client):
|
||||
"""
|
||||
Test scenario:
|
||||
|
||||
Reference in New Issue
Block a user