Sfoglia il codice sorgente

更新 'src/ranks.erl'

master
SisMaker 3 anni fa
parent
commit
13b6112fbf
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. +3
    -3
      src/ranks.erl

+ 3
- 3
src/ranks.erl Vedi File

@ -30,7 +30,7 @@ fieldIdx([Field | Fields], Idx, Acc) ->
startWork(Cnt) when Cnt > 0 ->
case ?ranksCfg:getV(?workCnt) of
0 ->
NameList = [{Idx, workName(Idx)} || Idx <- lists:seq(1, Cnt)],
NameList = [{Idx, workName(Idx)} || Idx <- lists:seq(0, Cnt - 1)],
[supervisor:start_child(rankWork_sup, [WorkName]) || {_Idx, WorkName} <- NameList],
CfgList = [{?workCnt, Cnt} | NameList],
Fields = record_info(fields, etsRankRecord),
@ -45,7 +45,7 @@ initRank(RankType, CntLimit, CntMax) ->
%% key
updateScore(RankType, Key, Score) ->
WorkName = ?ranksCfg:getV(erlang:phash2(Key, ?ranksCfg:getV(?workCnt)) + 1),
WorkName = ?ranksCfg:getV(erlang:phash2(Key, ?ranksCfg:getV(?workCnt))),
RankPos = ?ranksCfg:getV(RankType),
%%
%%
@ -55,7 +55,7 @@ updateScore(RankType, Key, Score) ->
%% key
updateInfo(Key, RecordKvs) ->
WorkName = ?ranksCfg:getV(erlang:phash2(Key, ?ranksCfg:getV(?workCnt)) + 1),
WorkName = ?ranksCfg:getV(erlang:phash2(Key, ?ranksCfg:getV(?workCnt))),
%%
%%
%% gen_srv:clfn(WorkName, rank_work, mUpdateInfo, [Key, RecordKvs]),

Caricamento…
Annulla
Salva