Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
99c77e7d
Commit
99c77e7d
authored
Sep 23, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tech(plugins): increase timeout
parent
e5c64732
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
pkg/log/log.go
+16
-2
pkg/plugins/update_checker.go
+6
-4
No files found.
pkg/log/log.go
View file @
99c77e7d
...
...
@@ -32,11 +32,25 @@ func New(logger string, ctx ...interface{}) Logger {
}
func
Trace
(
format
string
,
v
...
interface
{})
{
Root
.
Debug
(
fmt
.
Sprintf
(
format
,
v
))
var
message
string
if
len
(
v
)
>
0
{
message
=
fmt
.
Sprintf
(
format
,
v
)
}
else
{
message
=
format
}
Root
.
Debug
(
message
)
}
func
Debug
(
format
string
,
v
...
interface
{})
{
Root
.
Debug
(
fmt
.
Sprintf
(
format
,
v
))
var
message
string
if
len
(
v
)
>
0
{
message
=
fmt
.
Sprintf
(
format
,
v
)
}
else
{
message
=
format
}
Root
.
Debug
(
message
)
}
func
Debug2
(
message
string
,
v
...
interface
{})
{
...
...
pkg/plugins/update_checker.go
View file @
99c77e7d
...
...
@@ -11,6 +11,10 @@ import (
"github.com/grafana/grafana/pkg/setting"
)
var
(
httpClient
http
.
Client
=
http
.
Client
{
Timeout
:
time
.
Duration
(
10
*
time
.
Second
)}
)
type
GrafanaNetPlugin
struct
{
Slug
string
`json:"slug"`
Version
string
`json:"version"`
...
...
@@ -54,10 +58,8 @@ func getAllExternalPluginSlugs() string {
func
checkForUpdates
()
{
log
.
Trace
(
"Checking for updates"
)
client
:=
http
.
Client
{
Timeout
:
time
.
Duration
(
5
*
time
.
Second
)}
pluginSlugs
:=
getAllExternalPluginSlugs
()
resp
,
err
:=
c
lient
.
Get
(
"https://grafana.net/api/plugins/versioncheck?slugIn="
+
pluginSlugs
+
"&grafanaVersion="
+
setting
.
BuildVersion
)
resp
,
err
:=
httpC
lient
.
Get
(
"https://grafana.net/api/plugins/versioncheck?slugIn="
+
pluginSlugs
+
"&grafanaVersion="
+
setting
.
BuildVersion
)
if
err
!=
nil
{
log
.
Trace
(
"Failed to get plugins repo from grafana.net, %v"
,
err
.
Error
())
...
...
@@ -88,7 +90,7 @@ func checkForUpdates() {
}
}
resp2
,
err
:=
c
lient
.
Get
(
"https://raw.githubusercontent.com/grafana/grafana/master/latest.json"
)
resp2
,
err
:=
httpC
lient
.
Get
(
"https://raw.githubusercontent.com/grafana/grafana/master/latest.json"
)
if
err
!=
nil
{
log
.
Trace
(
"Failed to get latest.json repo from github: %v"
,
err
.
Error
())
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment