2
2
# socket.ioを利用したデータ読み書き (サーバ側)
3
3
#
4
4
5
- debug = require (' debug' )(' gyazz:sockets:readwrite ' )
5
+ debug = require (' debug' )(' gyazz:sockets:page ' )
6
6
mongoose = require ' mongoose'
7
7
async = require ' async'
8
8
@@ -29,7 +29,7 @@ module.exports = (app) ->
29
29
socket .leave room
30
30
31
31
socket .on ' read' , (req ) ->
32
- debug " readwrite.coffee: #{ wiki} ::#{ title} read request from client"
32
+ debug " #{ wiki} ::#{ title} read request from client"
33
33
Page .findByName wiki, title, req .opts , (err , page ) ->
34
34
debug " findByName callback"
35
35
if err
@@ -38,7 +38,7 @@ module.exports = (app) ->
38
38
data = page ? .text .split (/ \n / ) or []
39
39
# 行ごとの古さを計算する
40
40
Line .timestamps wiki, title, data, (err , timestamps ) ->
41
- debug " readwrite.coffee: send data back to client"
41
+ debug " send data back to client"
42
42
socket .emit ' pagedata' , { # 自分だけに返信
43
43
date : page ? .timestamp
44
44
timestamps : timestamps
@@ -50,7 +50,7 @@ module.exports = (app) ->
50
50
# pair.coffee でDBから取得している
51
51
#
52
52
socket .on ' write' , (req ) ->
53
- debug " readwrite.coffee: #{ wiki} ::#{ title} write request from client"
53
+ debug " #{ wiki} ::#{ title} write request from client"
54
54
text = req .data
55
55
keywords = req .keywords
56
56
0 commit comments