Developer forum

Forum » Swift » An active task with the given name ('Secondary users#Users.index#Users') already exists

An active task with the given name ('Secondary users#Users.index#Users') already exists

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I am trying to implement the "Manage users" functionality that is found in newer Swift versions.

I could recreate all pages and modules and I have copied all templates.

However, I get some errors related to some code within the ManageUsersInviteModal.cshtml template.
Specifically, here:

    string repository = "Secondary users";
    string indexName = "Users.index";
    string buildName = "Users";
 
    Dynamicweb.Indexing.IndexHelper.BuildIndexInstances(repository, indexName, buildName);

And here:

        Dynamicweb.Indexing.IndexHelper.BuildIndexInstances(repository, indexName, buildName);
        stopwatch.Start();
        Task.WaitAll(Task.Delay(250));

I have commented these lines but I am not sure about the impact to the end result.

If I understand correctly, this logic handles the update of the users index once an operation was performed.

Could this be replaced by this setting:

 

My solution is running on DW 9.13.14.

Thank you,

Adrian

 

 

 


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Yes, you can do that instead.

What you would be missing is the list of secondary users that might show a user that can no longer be impersonated. So nothing big.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you for the response. I understand the consequence and I agree the compromise is not that big.

But, nevertheless, this error is in the standard Swift templates. Is it related to some core DW/Swift code or some configuration on the solution?

I have checked the tasks defined and in my solution, there is no Active task with that name? Could it be that the indexing is first initiated and it is not closed until you get to the Delete part?

Thank you,
Adrian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Maybe - we are looking into the Swift implementation and might remove it or find a better solution.

 

You must be logged in to post in the forum