Compare commits
1 Commits
relative_r
...
fix/timeli
| Author | SHA256 | Date | |
|---|---|---|---|
|
|
6feb04a14d |
@@ -863,9 +863,10 @@ func (gitea *GiteaTransport) GetTimeline(org, repo string, idx int64) ([]*models
|
||||
TimelineCache, IsCached := giteaTimelineCache[prID]
|
||||
var LastCachedTime strfmt.DateTime
|
||||
if IsCached {
|
||||
l := len(TimelineCache.data)
|
||||
if l > 0 {
|
||||
LastCachedTime = TimelineCache.data[0].Updated
|
||||
for _, d := range TimelineCache.data {
|
||||
if time.Time(d.Updated).Compare(time.Time(LastCachedTime)) > 0 {
|
||||
LastCachedTime = d.Updated
|
||||
}
|
||||
}
|
||||
|
||||
// cache data for 5 seconds
|
||||
@@ -894,14 +895,20 @@ func (gitea *GiteaTransport) GetTimeline(org, repo string, idx int64) ([]*models
|
||||
}
|
||||
|
||||
for _, d := range res.Payload {
|
||||
if d != nil {
|
||||
if time.Time(d.Created).Compare(time.Time(LastCachedTime)) > 0 {
|
||||
// created after last check, so we append here
|
||||
TimelineCache.data = append(TimelineCache.data, d)
|
||||
} else {
|
||||
// we need something updated in the timeline, maybe
|
||||
if d == nil {
|
||||
continue
|
||||
}
|
||||
found := false
|
||||
for i := range TimelineCache.data {
|
||||
if TimelineCache.data[i].ID == d.ID {
|
||||
TimelineCache.data[i] = d
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
TimelineCache.data = append(TimelineCache.data, d)
|
||||
}
|
||||
}
|
||||
|
||||
if resCount < 10 {
|
||||
|
||||
@@ -139,7 +139,6 @@ index 0000000..e69de29
|
||||
|
||||
|
||||
@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 0000000..e69de29
|
||||
|
||||
|
||||
@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