Compare commits

..

No commits in common. "f51a19c537cbe63a9a670204c2c1c826af2506ed" and "721e422fa7a299d0dcfe9fe000c18f5e99380e37" have entirely different histories.

2 changed files with 4 additions and 9 deletions

View File

@ -13,13 +13,8 @@ import (
// TimeStamp defines a timestamp // TimeStamp defines a timestamp
type TimeStamp int64 type TimeStamp int64
var (
// mock is NOT concurrency-safe!! // mock is NOT concurrency-safe!!
mock time.Time var mock time.Time
// Used for IsZero, to check if timestamp is the zero time instant.
timeZeroUnix = time.Time{}.Unix()
)
// Set sets the time to a mocked time.Time // Set sets the time to a mocked time.Time
func Set(now time.Time) { func Set(now time.Time) {
@ -108,5 +103,5 @@ func (ts TimeStamp) FormatDate() string {
// IsZero is zero time // IsZero is zero time
func (ts TimeStamp) IsZero() bool { func (ts TimeStamp) IsZero() bool {
return int64(ts) == 0 || int64(ts) == timeZeroUnix return int64(ts) == 0
} }

View File

@ -340,7 +340,7 @@ func ListUnadoptedRepositories(query string, opts *db.ListOptions) ([]string, in
} }
repoNamesToCheck = append(repoNamesToCheck, name) repoNamesToCheck = append(repoNamesToCheck, name)
if len(repoNamesToCheck) >= setting.Database.IterateBufferSize { if len(repoNamesToCheck) > setting.Database.IterateBufferSize {
if err = checkUnadoptedRepositories(userName, repoNamesToCheck, unadopted); err != nil { if err = checkUnadoptedRepositories(userName, repoNamesToCheck, unadopted); err != nil {
return err return err
} }