Method: SQLite3::Database#busy_timeout=

Defined in:
ext/sqlite3/database.c

#busy_timeout=(ms) ⇒ Object Also known as: busy_timeout

Indicates that if a request for a resource terminates because that resource is busy, SQLite should sleep and retry for up to the indicated number of milliseconds. By default, SQLite does not retry busy resources. To restore the default behavior, send 0 as the ms parameter.

See also the mutually exclusive #busy_handler.



689
690
691
692
693
694
695
696
697
698
699
# File 'ext/sqlite3/database.c', line 689

static VALUE
set_busy_timeout(VALUE self, VALUE timeout)
{
    sqlite3RubyPtr ctx;
    TypedData_Get_Struct(self, sqlite3Ruby, &database_type, ctx);
    REQUIRE_OPEN_DB(ctx);

    CHECK(ctx->db, sqlite3_busy_timeout(ctx->db, (int)NUM2INT(timeout)));

    return self;
}