Skip to content

Commit 708a3be

Browse files
committed
server.d: use coarse timestamps for PMs and uptime
Makes the timestamp strings more readable. There's no need for high precision in these cases.
1 parent 19ce20f commit 708a3be

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/server/server.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import soulfind.server.user : User;
2222
import std.algorithm : sort;
2323
import std.array : Appender;
2424
import std.conv : text;
25-
import std.datetime : Clock, MonoTime, msecs, SysTime, UTC;
25+
import std.datetime : Clock, ClockType, MonoTime, msecs, SysTime, UTC;
2626
import std.random : unpredictableSeed;
2727
import std.stdio : writeln;
2828

@@ -47,7 +47,7 @@ final class Server
4747

4848
this(string db_filename)
4949
{
50-
this.started_at = Clock.currTime(UTC());
50+
this.started_at = Clock.currTime!(ClockType.second)(UTC());
5151
this.started_monotime = MonoTime.currTime;
5252
this.db = new Sdb(db_filename);
5353
this.conns = new UserConnections(this);
@@ -188,7 +188,7 @@ final class Server
188188

189189
pms[id] = PM(
190190
id,
191-
Clock.currTime(UTC()),
191+
Clock.currTime!(ClockType.second)(UTC()),
192192
from_username,
193193
to_username,
194194
message

0 commit comments

Comments
 (0)