Jump to content

Dealing with pending operation


Julien

Recommended Posts

Hello everyone,

I'm actually  working on a Registrar module and I would like some opinion on how to deal with pending operations. By that I mean maybe someone want's to order a domain name but the process can take between 0 seconds to a few days if technical issues arises,  and so our server might respond with an indication that the operation is pending, meaning it will be resolved but it's not instantaneous.

My line of thought would be to issue a warning/error when such an operation arise, saying something like 'Operation is being processed' or something close.
Then running a cron job that check our API if the operation is still pending or failed or is successful,  and then altering the DB in case of success.

My questions are:

- Did I oversee some crucials steps in this process?

- Could you point me to the table in the database that I might need to read/edit for this process to succeed?

- Is there a way to raise an actual warning? Not an error but a real warning?  For error I use $this->Input->setErrors, is

It's not a very clear question as I'm still thinking about it, any feedback would be appreciated.
And forgive me for my English.

Julien

 

Edit1: Also in documentation  it  talk about cron configuration only for plugins, not for modules. Will I run into any problem?

Edit2: I discovered this thread about  cron for module, I asked there if there were any news.

Link to comment
Share on other sites

When Blesta provisions a service and attempts to use your module to register a domain, it expects that the service be made active, so the module should create the domain and return success, or not create the domain and return failure. So you should determine whether the registrar creates the domain on the account regardless of any technical issues that might arise which they will later attempt to resolve.

Link to comment
Share on other sites

On 01/02/2018 at 9:57 AM, Julien said:

I'm actually  working on a Registrar module and I would like some opinion on how to deal with pending operations. By that I mean maybe someone want's to order a domain name but the process can take between 0 seconds to a few days if technical issues arises,  and so our server might respond with an indication that the operation is pending, meaning it will be resolved but it's not instantaneous.

My line of thought would be to issue a warning/error when such an operation arise, saying something like 'Operation is being processed' or something close.
Then running a cron job that check our API if the operation is still pending or failed or is successful,  and then altering the DB in case of success.

the best approuch to add the service, then show a message if is not yet active .

create a plugin that use cron to check the domain if active or not, after it activated then sync renew date if needed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...