-
Notifications
You must be signed in to change notification settings - Fork 890
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check every 5 minutes if we need to ping the update server for today
We were previously pinging the update server once an hour. However, that approach will undercount in the following scenario: a user's laptop sends a ping, the user closes the laptop, and the next day the user runs Brave for less than one hour.
- Loading branch information
Showing
6 changed files
with
55 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "brave/browser/brave_stats_updater_util.h" | ||
|
||
#include "base/strings/stringprintf.h" | ||
|
||
namespace brave { | ||
|
||
std::string GetDateAsYMD(const base::Time& time) { | ||
base::Time::Exploded exploded; | ||
time.LocalExplode(&exploded); | ||
return base::StringPrintf("%d-%02d-%02d", exploded.year, exploded.month, | ||
exploded.day_of_month); | ||
} | ||
|
||
} // namespace brave |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#ifndef BRAVE_BROWSER_BRAVE_STATS_UPDATER_UTIL_H_ | ||
#define BRAVE_BROWSER_BRAVE_STATS_UPDATER_UTIL_H_ | ||
|
||
#include <string> | ||
|
||
#include "base/time/time.h" | ||
|
||
namespace brave { | ||
|
||
std::string GetDateAsYMD(const base::Time& time); | ||
|
||
} // namespace brave | ||
|
||
#endif // BRAVE_BROWSER_BRAVE_STATS_UPDATER_UTIL_H_ |