summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2014-08-06 11:39:43 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2014-08-06 11:39:43 +0800
commit5e8bf5e24ffdc2d4ac9b206972f31c17684e91af (patch)
treedc9511827832b37b4755ee90f18ed00e9ad5389d
parent24c80edbe8ab810b24b67d4b48953b900095f13f (diff)
downloadpttbbs-5e8bf5e24ffdc2d4ac9b206972f31c17684e91af.tar
pttbbs-5e8bf5e24ffdc2d4ac9b206972f31c17684e91af.tar.gz
pttbbs-5e8bf5e24ffdc2d4ac9b206972f31c17684e91af.tar.bz2
pttbbs-5e8bf5e24ffdc2d4ac9b206972f31c17684e91af.tar.lz
pttbbs-5e8bf5e24ffdc2d4ac9b206972f31c17684e91af.tar.xz
pttbbs-5e8bf5e24ffdc2d4ac9b206972f31c17684e91af.tar.zst
pttbbs-5e8bf5e24ffdc2d4ac9b206972f31c17684e91af.zip
Use postd for all kinds of posts.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@6030 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rwxr-xr-xpttbbs/daemon/postd/postd.py12
-rw-r--r--pttbbs/mbbsd/bbs.c4
2 files changed, 8 insertions, 8 deletions
diff --git a/pttbbs/daemon/postd/postd.py b/pttbbs/daemon/postd/postd.py
index 18800667..9bfd7264 100755
--- a/pttbbs/daemon/postd/postd.py
+++ b/pttbbs/daemon/postd/postd.py
@@ -81,14 +81,16 @@ def SavePost(keypak, data, extra=None):
key = '%s/%s' % (keypak.board, keypak.file)
g_db.set(key, serialize(data))
logging.debug(' Saved: %s', key)
+ content_file = os.path.join(BBSHOME, 'boards', keypak.board[0],
+ keypak.board, keypak.file)
+ content_length = os.path.getsize(content_file)
start = time.time()
- g_db.set(key + ':content', open(os.path.join(BBSHOME,
- 'boards', keypak.board[0], keypak.board, keypak.file)).read())
+ g_db.set(key + ':content', open(content_file).read())
exec_time = time.time() - start
- logging.debug(' Content save time: %.3fs.', exec_time)
+ logging.debug(' Content (%d) save time: %.3fs.', content_length, exec_time)
if exec_time > 0.1:
- logging.error('%s/%s: save time: %.3fs.', keypak.board, keypak.file,
- exec_time)
+ logging.error('%s/%s: save time (%d bytes): %.3fs.',
+ keypak.board, keypak.file, content_length, exec_time)
def open_database(db_path):
global g_db
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c
index b462f10e..ba110fcc 100644
--- a/pttbbs/mbbsd/bbs.c
+++ b/pttbbs/mbbsd/bbs.c
@@ -1671,9 +1671,7 @@ do_post_article(int edflags)
add_posttimes(usernum, 1);
#endif
#ifdef USE_POSTD
- if (edflags & EDITFLAG_KIND_NEWPOST) {
- PostAddRecord(currboard, &postfile, dashc(fpath));
- }
+ PostAddRecord(currboard, &postfile, dashc(fpath));
#endif
}
pressanykey();