Commit 8dce69081b2f7acd5fb50013d91e9fcf32194db3

Authored by zhouahaihai
1 parent 9ad697c8

配表由两个位置读取

Showing 1 changed file with 7 additions and 7 deletions   Show diff stats
src/services/csvdatad.lua
@@ -8,7 +8,7 @@ require "csvdata.init" @@ -8,7 +8,7 @@ require "csvdata.init"
8 require "skynet.manager" 8 require "skynet.manager"
9 require "RedisKeys" 9 require "RedisKeys"
10 10
11 -local csvdb = {} 11 +-- local csvdb = {}
12 12
13 local function formatFileName(filename) 13 local function formatFileName(filename)
14 filename = string.trim(filename) 14 filename = string.trim(filename)
@@ -33,14 +33,14 @@ local function travCsv(rootPath, pathes) @@ -33,14 +33,14 @@ local function travCsv(rootPath, pathes)
33 modified = travCsv(pathfile, pathes) or modified 33 modified = travCsv(pathfile, pathes) or modified
34 else 34 else
35 local basename, loadname = formatFileName(pathfile) 35 local basename, loadname = formatFileName(pathfile)
36 - if basename and tonum(pathes[loadname]) < attrs.modification then  
37 - modified = true  
38 - if basename == "init" then 36 + if basename then
  37 + if tonum(pathes[loadname]) < attrs.modification then
  38 + modified = true
  39 + pathes[loadname] = attrs.modification
  40 + end
  41 + if basename == "init" or basename == "init_adv" then
39 require(loadname) 42 require(loadname)
40 - else  
41 - csvdb[basename .. "Csv"] = require(loadname)  
42 end 43 end
43 - pathes[loadname] = attrs.modification  
44 end 44 end
45 end 45 end
46 end 46 end