WebFaction
Community site: login faq

is there a way to create an application and create a site, that uses it, atomically from my script using the API? (I am using Ruby, but it does not matter much).

that is, if site creation fails, then the app gets rolled back.

asked 07 Jun '13, 10:27

akonsu
64714
accept rate: 100%

edited 07 Jun '13, 10:28


Sure, that's simple:

  • Store the app info in a variable after the app is created.
  • Wrap your create_website call in an exception handler.
  • If create_website fails, have your exception handler pass the app info to delete_app.
permanent link

answered 07 Jun '13, 10:57

seanf
12.2k42136
accept rate: 37%

yes. thanks. I suppose I need to invent some kind of locking to handle concurrent jobs that attempt to create sites. while one is creating a site, others should wait.

(07 Jun '13, 11:02) akonsu
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×82
×76

question asked: 07 Jun '13, 10:27

question was seen: 2,094 times

last updated: 07 Jun '13, 11:02

                              
WEBFACTION
REACH US
SUPPORT
LEGAL
© COPYRIGHT 2003-2021 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM