forked from forgejo/forgejo
Refactor struct's time to remove unnecessary memory usage (#3142)
* refactor struct's time to remove unnecessary memory usage * use AsTimePtr simple code * fix tests * fix time compare * fix template on gpg * use AddDuration instead of Add
This commit is contained in:
parent
c082c3bce3
commit
f2e20c81b6
67 changed files with 334 additions and 479 deletions
|
@ -97,7 +97,7 @@ func IsWatching(ctx *context.APIContext) {
|
|||
Subscribed: true,
|
||||
Ignored: false,
|
||||
Reason: nil,
|
||||
CreatedAt: ctx.Repo.Repository.Created,
|
||||
CreatedAt: ctx.Repo.Repository.CreatedUnix.AsTime(),
|
||||
URL: subscriptionURL(ctx.Repo.Repository),
|
||||
RepositoryURL: repositoryURL(ctx.Repo.Repository),
|
||||
})
|
||||
|
@ -134,7 +134,7 @@ func Watch(ctx *context.APIContext) {
|
|||
Subscribed: true,
|
||||
Ignored: false,
|
||||
Reason: nil,
|
||||
CreatedAt: ctx.Repo.Repository.Created,
|
||||
CreatedAt: ctx.Repo.Repository.CreatedUnix.AsTime(),
|
||||
URL: subscriptionURL(ctx.Repo.Repository),
|
||||
RepositoryURL: repositoryURL(ctx.Repo.Repository),
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue