I'm seeing an odd bug when I try to reset a projec...
# ask-community
j
I'm seeing an odd bug when I try to reset a project (delete it and then recreate it). Here's a example of what I'm trying:
Copy code
client.create_project(project_name="Hello, World!")
is_successful = client.delete_project(project_name="Hello, World!")
client.create_project(project_name="Hello, World!")  # FAILS HERE
The second call to create_project fails with a ClientError due to a uniqueness violation -- but in raising that error, the client is unable to tell which existing project causes the uniqueness violation (bc I just deleted it). Would anyone have insight as to what's going on here? I've tried sleeping between each line too so I don't think this is a race condition, but I'm not totally sure.
k
Hey @Jack Sundberg, project deletion is a lazy operation (it gets hidden but not deleted from the database). Is this a one time operation or you are doing this regularly?
j
I'm doing this regularly as I develop my project 😬
k
Well….I’m sorry but I don’t think I can help much 😅. I think the recreation of the project might work but I think it takes a while (30 mins+ if I have to guess). The only thing I can suggest is to split the projects so you have a project for dev work so that you don’t need to reset the project like this.
j
lol alright I can do that.
what causes a lazy operation to actually execute? Does it wait in a queue?
k
It’s more like batching of requests from my very naive understanding.
j
gotcha. haha well that's good to know this is a lazy op then. thank you!
a
hey @Kevin Kho, sorry to resurrect an old thread, but just curious -- when you say "it takes a while", you mean that it's hidden in the DB and then eventually deleted, right?
hah, answered my own question -- 10 minutes after deletion, was able to re-create.
k
Yes that’s right. Glad you got it figured out.