Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in / Register
Toggle navigation
Poduptime
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
11
Issues
11
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
Poduptime
Commits
b074a132
Commit
b074a132
authored
Apr 14, 2019
by
dmorley
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'curl-timeout' into 'develop'
Curl timeout See merge request
diasporg/Poduptime!237
parents
a18b81d4
3db36fc9
Pipeline
#1456
passed with stage
in 2 minutes and 48 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
CHANGELOG.md
CHANGELOG.md
+1
-0
db/update-remote-data.php
db/update-remote-data.php
+2
-2
lib/functions.php
lib/functions.php
+3
-3
No files found.
CHANGELOG.md
View file @
b074a132
...
...
@@ -4,6 +4,7 @@ The format is based on [Keep a Changelog] and this project adheres to [Semantic
## [Unreleased]
### Added
### Changed
-
curl function timeout can be changed from 15 second default
### Deprecated
### Removed
### Fixed
...
...
db/update-remote-data.php
View file @
b074a132
...
...
@@ -31,7 +31,7 @@ $existingpods = array_column($pods, 'domain');
$foundpods
=
[];
//pulling all nodes for now
$federationpods
=
curl
(
'https://the-federation.info/graphql?query=%7Bnodes%7Bhost%20platform%7Bname%7Dprotocols%7Bname%7D%7D%7D&raw'
);
$federationpods
=
curl
(
'https://the-federation.info/graphql?query=%7Bnodes%7Bhost%20platform%7Bname%7Dprotocols%7Bname%7D%7D%7D&raw'
,
false
,
45
);
if
(
$pods
=
json_decode
(
$federationpods
[
'body'
]
?:
''
,
true
))
{
foreach
(
$pods
[
'data'
][
'nodes'
]
??
[]
as
$poddata
)
{
$protocols
=
array_column
(
$poddata
[
'protocols'
]
??
[],
'name'
);
...
...
@@ -39,7 +39,7 @@ if ($pods = json_decode($federationpods['body'] ?: '', true)) {
}
}
$diasppods
=
curl
(
'https://diasp.org/pods.json'
);
$diasppods
=
curl
(
'https://diasp.org/pods.json'
,
false
,
45
);
if
(
$pods
=
json_decode
(
$diasppods
[
'body'
]
?:
''
,
true
))
{
foreach
(
$pods
??
[]
as
$poddata
)
{
$foundpods
[]
=
strtolower
(
$poddata
[
'host'
]);
...
...
lib/functions.php
View file @
b074a132
...
...
@@ -105,12 +105,12 @@ function debug($label, $var = null, $dump = false): void
*
* @return array
*/
function
curl
(
string
$url
,
bool
$follow
=
false
)
:
array
function
curl
(
string
$url
,
bool
$follow
=
false
,
$timeout
=
15
)
:
array
{
$chss
=
curl_init
();
curl_setopt
(
$chss
,
CURLOPT_URL
,
$url
);
curl_setopt
(
$chss
,
CURLOPT_CONNECTTIMEOUT
,
5
);
curl_setopt
(
$chss
,
CURLOPT_TIMEOUT
,
15
);
curl_setopt
(
$chss
,
CURLOPT_CONNECTTIMEOUT
,
$timeout
);
curl_setopt
(
$chss
,
CURLOPT_TIMEOUT
,
$timeout
);
curl_setopt
(
$chss
,
CURLOPT_RETURNTRANSFER
,
true
);
curl_setopt
(
$chss
,
CURLOPT_FAILONERROR
,
true
);
curl_setopt
(
$chss
,
CURLOPT_CERTINFO
,
true
);
...
...
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