GitHub: Use Time.timestamp instead of Date.now
The timestamp is now Epoch Unix style (in seconds rather than ms)
This commit is contained in:
parent
0d196b2917
commit
e3ff4e5bcf
1 changed files with 4 additions and 4 deletions
|
|
@ -57,13 +57,13 @@ Singleton {
|
||||||
|
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
function loadFromCache() {
|
function loadFromCache() {
|
||||||
const now = Date.now()
|
const now = Time.timestamp
|
||||||
if (!data.timestamp || (now - data.timestamp > githubUpdateFrequency * 1000)) {
|
if (!data.timestamp || (now >= data.timestamp + githubUpdateFrequency)) {
|
||||||
console.log("[GitHub] Cache expired or missing, fetching new data from GitHub...")
|
console.log("[GitHub] Cache expired or missing, fetching new data from GitHub...")
|
||||||
fetchFromGitHub()
|
fetchFromGitHub()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log("[GitHub] Loading cached GitHub data (age:", Math.round((now - data.timestamp) / 60000),"minutes)")
|
console.log("[GitHub] Loading cached GitHub data (age:", Math.round((now - data.timestamp) / 60), "minutes)")
|
||||||
|
|
||||||
if (data.version) {
|
if (data.version) {
|
||||||
root.latestVersion = data.version
|
root.latestVersion = data.version
|
||||||
|
|
@ -87,7 +87,7 @@ Singleton {
|
||||||
|
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
function saveData() {
|
function saveData() {
|
||||||
data.timestamp = Date.now()
|
data.timestamp = Time.timestamp
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
// Access the FileView's writeAdapter method
|
// Access the FileView's writeAdapter method
|
||||||
var fileView = root.children.find(child => child.objectName === "githubDataFileView")
|
var fileView = root.children.find(child => child.objectName === "githubDataFileView")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue