After calling RegMan.AddReg/DelReg/ChangeReg funtions HUB automatically call RegMan.Save function to save base on HDD.
When I calling RegMan.DelReg on my HUB with RegBase ~5000 users, removal of Regs works very slowly (~5 Regs/second) because of write of base on a HDD after every DelReg.
I suggest to make optional ignoring of autosave RegBase after RegMan.AddReg/DelReg/ChangeReg funtions.
Example: RegMan.DelReg(sNick, bNoSave) or RegMan.DelRegFast(sNick)
Agree with WAJIM. Recently i removed about ~8000 regs, i had use timer to clear reg base on working hub.
Also, i don't want to create a new topic, so how about make a ProfMan.Save() function? Now only shutdown or restart saves profiles.
Quote from: Mutor on 08 January, 2010, 16:38:41
Why would you delete 8000 registered accounts?
I see no practical or reasonable cause for this.
Just to delete regs that are not used for a long time... Less regs gives a best performance, i think :)
Quote from: Mutor on 08 January, 2010, 16:38:41
Why would you delete 8000 registered accounts?
No, every month invokes purging function, that removes unused accounts, ~100-300. ::)
QuoteAnd if the hub should fail by script or system issues before a save is made
These are my problems. :P
Quote from: Mutor on 08 January, 2010, 16:57:21dump 8k users at once is foolish.
Yes. But it's first time when i clear my reg base ;D
So, if some linux user needs this function now:
0) Create a backup ;D
1) open
src/LuaRegManLib.cpp2) Find function started with
static int DelReg(lua_State * L)3) Copy this function with new name like
static int DelRegFast(lua_State * L)4) Delete
hashRegManager->Save(); in the end of the function
5) Find
static const luaL_reg regman_funcs[] = {6) Add
{ "DelRegFast", DelRegFast }, to this array
7) Compile and enjoy :)
Quote from: Mutor on 08 January, 2010, 16:57:21
but it would seem your problems and WAJIM's may well be due to poor scripting methods.
No, I well see, how the size of RegisteredUsers.xml changes in a range from 0 up to 800K many times when I make many RegMan.DelReg calls.
Quote from: Mutor on 08 January, 2010, 17:05:03Add to that the risk of losing changes made on crash
Following this logic, why settings and bans aren't saved automatically after calling SetMan.Set... ?
Quote from: Mutor on 08 January, 2010, 17:05:03
. Is everyone in Russia crazy? :P
Oh, yes ;D
Quote from: Mutor on 08 January, 2010, 17:08:23
Well that's the point, properly coded, you would never BE making many DelReg calls.
No, simply the hub should process function correctly, instead of through an ass. :-*
QuoteThe xml file will be the size it needs to be when you're done fucking with it.
Is it any wonder the file size changes when it's being re-written?
Therefore I have created this topic. For improvement of work with database.
For what purposes there is a function RegMan.Save() ?! ???
Quote from: Enuri on 08 January, 2010, 16:59:43
So, if some linux user needs this function now:
Thanks, but I'm win32 user. :-\
Quote from: Mutor on 08 January, 2010, 17:05:03
Is everyone in Russia crazy? :P
YES! ;D
Problem fixed, removed auto save. From PtokaX 0.4.1.2 it will be scripter responsibility to save regs when it is needed :P
Quote from: PPK on 08 January, 2010, 23:16:11
Problem fixed, removed auto save.
Thanks, PPK! :D