Code Monkey home page Code Monkey logo

Comments (5)

Schmaga avatar Schmaga commented on June 9, 2024

Isn't what you are looking for simply injecting the DurableTaskClient and then calling PurgeInstanceAsync, PurgeInstancesAsyncor PurgeAllInstancesAsync like this:

[Function("TerminateSomething")]
public async Task<HttpResponseData> Run([DurableClient] DurableTaskClient client) 
{
     await client.PurgeInstanceAsync("SomeInstanceId");
}

It is what we are using to clean-up, and it works in general, except for the yet to be triaged problem mentioned here #143 (comment)

from durabletask-dotnet.

viktoraandersson avatar viktoraandersson commented on June 9, 2024

Isn't what you are looking for simply injecting the DurableTaskClient and then calling PurgeInstanceAsync, PurgeInstancesAsyncor PurgeAllInstancesAsync like this:

[Function("TerminateSomething")]
public async Task<HttpResponseData> Run([DurableClient] DurableTaskClient client) 
{
     await client.PurgeInstanceAsync("SomeInstanceId");
}

It is what we are using to clean-up, and it works in general, except for the yet to be triaged problem mentioned here #143 (comment)

Won't that purge the instance table and not history table (or perhaps both)? What I want to do is remove history but not instances.

from durabletask-dotnet.

Schmaga avatar Schmaga commented on June 9, 2024

From what I can gather, it does both. There are no other operations.

from durabletask-dotnet.

davidmrdavid avatar davidmrdavid commented on June 9, 2024

@viktoraandersson: can you tell me a bit more about your use case? Why are you trying to delete only the instance table and not the history table.

Also, I believe the purgeInstanceAsync API in the isolated SDK has the same side effects as the in-process SDK. I don't believe we've changed the semantics here.

from durabletask-dotnet.

viktoraandersson avatar viktoraandersson commented on June 9, 2024

@viktoraandersson: can you tell me a bit more about your use case? Why are you trying to delete only the instance table and not the history table.

Also, I believe the purgeInstanceAsync API in the isolated SDK has the same side effects as the in-process SDK. I don't believe we've changed the semantics here.

Sure! It's the other way around though, I want to delete history and not instance table.

The use case:
I have IOT devices which gets setup by the durable function. Each device has a unique ID, and I use this ID as instance ID for the durable function. This way I can make sure only one setup is running per device. I can use DurableTaskClient.GetInstancesAsync to get some metadata and e.g. determine if someone is already running setup for this device.

Because of this I want to keep the data in the instance table. I want to purge instance history though as this can otherwise grow infinitely.

Am I misunderstanding something perhaps? Which tables are purged with IDurableOrchestrationClient .PurgeInstanceHistoryAsync and which are purged with DurableTaskClient.PurgeInstanceAsync? Or am I abusing the use of the instance ID in my use case somehow?

from durabletask-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.