 # Start a server process
 start = (env) ->
   worker = cluster.fork "NODE_ENV": env
+  # error record
   worker.on 'message', (err) ->
+    index = 0
+    length = 0
+    for key of errors
+      length++
+      index = key if (key isnt 'index') and (index is 0)
+    delete errors[index] if length > MAX_ERRS
     errors.index++
     errors[errors.index] = err
+  # start process
   pid = worker.process.pid
   date = new Date()
   year = date.getFullYear()


# Dispaly error infomation
error = (ids) ->
  # select a error
  if ids.length > 0
    for id in ids
      fixed = false
      if id.indexOf('-') is 0

\n    add [<cpus>]              add a server process, each process uses a cpu
\n                              core, default add 1 process
\n    clear                     clear screen
\n    error [[-]<id>] [+<max>]  list all internal errors, check error
\n                              information by error id or delete error by
\n                              error id
\n                              +<max> to set the max number of error log,
\n                              default max number is 20
\n    help                      commands help infomation
\n    list                      list all server processes
\n    remove <pid>              shutdown a server process by process id
