Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Assignment 1
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aksel Baardsen
Assignment 1
Commits
e8edf67a
Commit
e8edf67a
authored
Oct 13, 2019
by
Aksel Baardsen
Browse files
Options
Downloads
Patches
Plain Diff
diag uptime is now int instead of float
parent
a775aa99
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.go
+1
-1
1 addition, 1 deletion
main.go
pkg/diag.go
+2
-2
2 additions, 2 deletions
pkg/diag.go
with
3 additions
and
3 deletions
main.go
+
1
−
1
View file @
e8edf67a
...
@@ -25,7 +25,7 @@ func main() {
...
@@ -25,7 +25,7 @@ func main() {
c
.
Path
(
"/species/{speciesKey}"
)
.
c
.
Path
(
"/species/{speciesKey}"
)
.
HandlerFunc
(
handler
.
Shandler
)
HandlerFunc
(
handler
.
Shandler
)
c
.
Path
(
"/diag"
)
.
c
.
Path
(
"/diag
/
"
)
.
HandlerFunc
(
handler
.
Dhandler
)
HandlerFunc
(
handler
.
Dhandler
)
http
.
Handle
(
"/"
,
r
)
http
.
Handle
(
"/"
,
r
)
...
...
This diff is collapsed.
Click to expand it.
pkg/diag.go
+
2
−
2
View file @
e8edf67a
...
@@ -17,7 +17,7 @@ type Diag struct {
...
@@ -17,7 +17,7 @@ type Diag struct {
Gbif
int
`json:"gbif"`
Gbif
int
`json:"gbif"`
Restcountries
int
`json:"restcountries"`
Restcountries
int
`json:"restcountries"`
Version
string
`json:"version"`
Version
string
`json:"version"`
Uptime
float64
`json:"uptime"`
Uptime
int
`json:"uptime"`
}
}
func
GetDiag
(
d
*
Diag
)
{
func
GetDiag
(
d
*
Diag
)
{
...
@@ -50,5 +50,5 @@ func getVersion(d *Diag) {
...
@@ -50,5 +50,5 @@ func getVersion(d *Diag) {
// Returns application uptime in seconds
// Returns application uptime in seconds
func
getUptime
(
d
*
Diag
)
{
func
getUptime
(
d
*
Diag
)
{
up
:=
time
.
Since
(
startTime
)
.
Seconds
()
up
:=
time
.
Since
(
startTime
)
.
Seconds
()
d
.
Uptime
=
up
d
.
Uptime
=
int
(
up
)
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment