Store earlier

merge-requests/3/merge
Bob Mottram 2019-11-13 15:32:46 +00:00
parent 340d301ec4
commit 1f50dfdc19
1 changed files with 14 additions and 14 deletions

View File

@ -2808,6 +2808,20 @@ class PubServer(BaseHTTPRequestHandler):
if not fields.get('location'): if not fields.get('location'):
fields['location']=None fields['location']=None
# Store a file which contains the time in seconds
# since epoch when an attempt to post something was made.
# This is then used for active monthly users counts
lastUsedFilename= \
self.server.baseDir+'/accounts/'+ \
nickname+'@'+self.server.domain+'/.lastUsed'
try:
lastUsedFile=open(lastUsedFilename,'w')
if lastUsedFile:
lastUsedFile.write(str(int(time.time())))
lastUsedFile.close()
except:
pass
if postType=='newpost': if postType=='newpost':
messageJson= \ messageJson= \
createPublicPost(self.server.baseDir, \ createPublicPost(self.server.baseDir, \
@ -2834,20 +2848,6 @@ class PubServer(BaseHTTPRequestHandler):
else: else:
return -1 return -1
# Store a file which contains the time in seconds
# since epoch when an attempt to post something was made.
# This is then used for active monthly users counts
lastUsedFilename= \
self.server.baseDir+'/accounts/'+ \
nickname+'@'+self.server.domain+'/.lastUsed'
try:
lastUsedFile=open(lastUsedFilename,'w')
if lastUsedFile:
lastUsedFile.write(str(int(time.time())))
lastUsedFile.close()
except:
pass
if postType=='newunlisted': if postType=='newunlisted':
messageJson= \ messageJson= \
createUnlistedPost(self.server.baseDir, \ createUnlistedPost(self.server.baseDir, \