docs: function requestWrite (database) {
    var deferred = q.defer();
  
    // Is the database currently being written?
    if(writing[database]) {
      deferred.reject('Database is being written');
      return deferred.promise();
    }
  
    writing[database] = true;
  
    // Write the database
    write(database).then(function () {
      deferred.resolve();
    }, function (err) {
      deferred.reject(err);
    });
  
    var time = globalConfig.db.fileTimeout;
  
    if(time <= 0) {
      // If there's no time limit for writing, then clear out block
      delete writing[database];
    } else {
      // If there's a time limit, wait for time to pass and remove block
      setTimeout(function () {
        delete writing[database];
      }, time);
    }
  
    return deferred.promise;
  }