[ircd-ratbox] ratbox-services and database hooks, where to begin.
lee at leeh.co.uk
Thu Dec 17 18:24:41 UTC 2009
On Tue, Dec 15, 2009 at 08:22:18PM -0500, Ryan wrote:
> >I don't mind making some adaptations to the hook system, for example if
> >you'd prefer rserv to mark rows in users_sync as 'complete' or 'error' for
> >example so you can track them back in Drupal.
> Your suggestion here leads me to believe that entries in users_sync
> are not flushed after
> they are added to the main users table, is this correct? Assuming
> that there were no
> errors when adding a user with the register database hook, the new
> entry should be in
> the main users table upon the next database update by rserv if I
> understand you. If that's
> true, then I would use that as a means of error checking. Flushing
> entries from users_sync,
> if they are not already being done, would be another method. I have
> not currently had
> a chance to look at the mysql database (I originally chose to use
> sqlite as the backend),
> so I could be entirely mistaken.
Currently, rserv will scan users_sync and once it has completed an entry
from the table, it will delete the row for that entry.
If it has an error parsing the entry (e.g. the username it is asked to
register is invalid), it will just leave the row alone.
My natural inclination is that for what you want, there are better ways of
rserv passing information 'back'. Specifically, I think it would be better
if I extended the users_sync table with another two columns -- 'completed'
and 'error_string'. When rserv has dealt with an entry from the table, it
will alter the completed flag to 1 if it succeeded. If it failed for some
reason, it will set it to -1 and then set an appropriate message into the
'error_string' explaining why it failed.
This will effectively allow you to go back and interrogate the users_sync
table to confirm whether rserv has dealt with it or not -- without a
somewhat nasty test of "does this row no longer exist".
I'm happy enough to do that modification -- I need to cut a 1.2.2rc1 soon
enough anyway, so I can fold it into that..
On a minor side note however, I would mention that if you are going to be
making extensive use of rserv you may want to consider moving from
ircd-hybrid to ircd-ratbox at some point -- specifically for reasons
- Lee H // anfl
- I code, therefore I break things.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: Digital signature
More information about the ircd-ratbox