From 5d3886bb51a196a4d4d6e5b1b418a89d0860d9f7 Mon Sep 17 00:00:00 2001 From: iridiumR Date: Mon, 7 Aug 2023 23:58:01 +0800 Subject: [PATCH] fix bugs --- PKGBUILD | 4 ++-- uptimes | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index cfaa843..9749bb3 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: 1ridic pkgname=uptimes -pkgver=0.1.9 +pkgver=0.1.10 pkgrel=1 pkgdesc="status of total uptime" arch=('any') @@ -11,7 +11,7 @@ source=( local://uptimes local://uptimesd.service ) -md5sums=('9eecdc39ee18e28843b1e113fd6090c6' +md5sums=('542ca1de161e15d32b386e9470ac6811' '7a90889f87792317e70ebdce9dae7023') package() { diff --git a/uptimes b/uptimes index de18b43..9cbfd7f 100755 --- a/uptimes +++ b/uptimes @@ -40,7 +40,17 @@ def timeInit(): def updateTime(): global uptime, startTime, totalTime now = readTime() + print("Now: %f" % now) + sys.stdout.flush() + print("Uptime: %f" % uptime) + sys.stdout.flush() + print("startTime: %f" % startTime) + sys.stdout.flush() + print("totalTime: %f" % totalTime) + sys.stdout.flush() totalTime += now - startTime + print("totalTime: %f" % totalTime) + sys.stdout.flush() with open(uptimes_db, 'w') as f: f.write(str(totalTime)) @@ -196,7 +206,7 @@ def daemon(fork = True): elif data == b'get': updateTime() - conn.sendall(b'%f' % uptime) + conn.sendall(b'%f' % totalTime) conn.close() continue