Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
1
1weather
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Dmitriy Stepanets
1weather
Commits
548a52f7
Commit
548a52f7
authored
Apr 12, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shorter update period for debug build per Ritesh's request.
parent
f5b2e890
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
1Weather/Network/Health/BlendHealthSource.swift
+4
-1
1Weather/Network/Weather/WdtWeatherSource.swift
+4
-1
No files found.
1Weather/Network/Health/BlendHealthSource.swift
View file @
548a52f7
...
@@ -28,8 +28,11 @@ public class BlendHealthSource: HealthSource {
...
@@ -28,8 +28,11 @@ public class BlendHealthSource: HealthSource {
}
}
private
static
let
blendAPIKeyHeaderName
=
"blend-api-key"
private
static
let
blendAPIKeyHeaderName
=
"blend-api-key"
private
static
let
blendAPIKey
=
"0imfnc8mVLWwsAawjYr4Rx-Af50DDqtlx"
private
static
let
blendAPIKey
=
"0imfnc8mVLWwsAawjYr4Rx-Af50DDqtlx"
#if DEBUG
public
var
healthUpdateInterval
:
TimeInterval
=
TimeInterval
(
2
*
60
)
// 2 minutes
#else
public
var
healthUpdateInterval
:
TimeInterval
=
TimeInterval
(
15
*
60
)
// 15 minutes
public
var
healthUpdateInterval
:
TimeInterval
=
TimeInterval
(
15
*
60
)
// 15 minutes
#endif
/// This queue is needed to synchronize access to locationsBeingUpdated. Also, to make logging more clear.
/// This queue is needed to synchronize access to locationsBeingUpdated. Also, to make logging more clear.
private
let
internalQueue
:
OperationQueue
=
{
private
let
internalQueue
:
OperationQueue
=
{
let
queue
=
OperationQueue
()
let
queue
=
OperationQueue
()
...
...
1Weather/Network/Weather/WdtWeatherSource.swift
View file @
548a52f7
...
@@ -32,8 +32,11 @@ public class WdtWeatherSource: WeatherSource {
...
@@ -32,8 +32,11 @@ public class WdtWeatherSource: WeatherSource {
}()
}()
private
var
locationsBeingUpdated
=
Set
<
Location
>
()
private
var
locationsBeingUpdated
=
Set
<
Location
>
()
#if DEBUG
public
let
weatherUpdateInterval
=
TimeInterval
(
2
*
60
)
// 2 minutes
#else
public
let
weatherUpdateInterval
=
TimeInterval
(
15
*
60
)
// 15 minutes
public
let
weatherUpdateInterval
=
TimeInterval
(
15
*
60
)
// 15 minutes
#endif
public
func
updateWeather
(
for
location
:
Location
,
type
:
WeatherUpdateType
,
completion
:
@escaping
WeatherSourceCompletion
)
{
public
func
updateWeather
(
for
location
:
Location
,
type
:
WeatherUpdateType
,
completion
:
@escaping
WeatherSourceCompletion
)
{
internalQueue
.
addOperation
{
[
weak
self
]
in
internalQueue
.
addOperation
{
[
weak
self
]
in
...
...
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