Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Add support for sqlite3_interrupt" #630

Merged
merged 1 commit into from
Apr 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions src/database.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ NAN_MODULE_INIT(Database::Init) {
Nan::SetPrototypeMethod(t, "serialize", Serialize);
Nan::SetPrototypeMethod(t, "parallelize", Parallelize);
Nan::SetPrototypeMethod(t, "configure", Configure);
Nan::SetPrototypeMethod(t, "interrupt", Interrupt);

NODE_SET_GETTER(t, "open", OpenGetter);

Expand Down Expand Up @@ -225,8 +224,6 @@ void Database::Work_BeginClose(Baton* baton) {
assert(baton->db->pending == 0);

baton->db->RemoveCallbacks();
baton->db->closing = true;

int status = uv_queue_work(uv_default_loop(),
&baton->request, Work_Close, (uv_after_work_cb)Work_AfterClose);
assert(status == 0);
Expand All @@ -252,8 +249,6 @@ void Database::Work_AfterClose(uv_work_t* req) {
Baton* baton = static_cast<Baton*>(req->data);
Database* db = baton->db;

db->closing = false;

Local<Value> argv[1];
if (baton->status != SQLITE_OK) {
EXCEPTION(Nan::New(baton->message.c_str()).ToLocalChecked(), baton->status, exception);
Expand Down Expand Up @@ -356,21 +351,6 @@ NAN_METHOD(Database::Configure) {
info.GetReturnValue().Set(info.This());
}

NAN_METHOD(Database::Interrupt) {
Database* db = Nan::ObjectWrap::Unwrap<Database>(info.This());

if (!db->open) {
return Nan::ThrowError("Database is not open");
}

if (db->closing) {
return Nan::ThrowError("Database is closing");
}

sqlite3_interrupt(db->_handle);
info.GetReturnValue().Set(info.This());
}

void Database::SetBusyTimeout(Baton* baton) {
assert(baton->db->open);
assert(baton->db->_handle);
Expand Down
4 changes: 0 additions & 4 deletions src/database.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ class Database : public Nan::ObjectWrap {
_handle(NULL),
open(false),
locked(false),
closing(false),
pending(0),
serialize(false),
debug_trace(NULL),
Expand Down Expand Up @@ -152,8 +151,6 @@ class Database : public Nan::ObjectWrap {

static NAN_METHOD(Configure);

static NAN_METHOD(Interrupt);

static void SetBusyTimeout(Baton* baton);

static void RegisterTraceCallback(Baton* baton);
Expand All @@ -174,7 +171,6 @@ class Database : public Nan::ObjectWrap {
sqlite3* _handle;

bool open;
bool closing;
bool locked;
unsigned int pending;

Expand Down
69 changes: 0 additions & 69 deletions test/interrupt.test.js

This file was deleted.