Skip to content

Commit

Permalink
removed previous suffix when auto renaming measurement name
Browse files Browse the repository at this point in the history
  • Loading branch information
kolinger committed Apr 15, 2019
1 parent a37d503 commit 1b21bf2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions webapp/backend.py
@@ -1,5 +1,6 @@
import json
import logging
import re
import sys
from threading import Thread
import time
Expand Down Expand Up @@ -36,6 +37,9 @@ def on_open(self, sid, data):
if last:
now = arrow.now()
if now.timestamp - int(last["timestamp"]) > 3600:
match = re.match(".+( [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2})$", data["name"])
if match:
data["name"] = data["name"][:-len(match.group(1))]
data["name"] += " " + arrow.now().format("YYYY-MM-DD HH:mm")
self.config.write("name", data["name"])

Expand Down

0 comments on commit 1b21bf2

Please sign in to comment.