require a flag to enable payment to assigned nodes

This commit is contained in:
Stephen Birarda 2014-05-21 11:02:02 -07:00
parent 1dddabb691
commit b7727f0b16

View file

@ -191,9 +191,11 @@ void DomainServer::setupNodeListAndAssignments(const QUuid& sessionUUID) {
bool DomainServer::optionallyLoginAndSetupAssignmentPayment() {
// check if we have a username and password set via env
const QString ASSIGNED_NODE_PAYMENT_OPTION = "pay-nodes";
const QString HIFI_USERNAME_ENV_KEY = "DOMAIN_SERVER_USERNAME";
const QString HIFI_PASSWORD_ENV_KEY = "DOMAIN_SERVER_PASSWORD";
if (_argumentVariantMap.contains(ASSIGNED_NODE_PAYMENT_OPTION)) {
if (!_oauthProviderURL.isEmpty()) {
AccountManager& accountManager = AccountManager::getInstance();
@ -229,6 +231,13 @@ bool DomainServer::optionallyLoginAndSetupAssignmentPayment() {
const qint64 TRANSACTION_SEND_INTERVAL_MSECS = 30 * 1000;
nodePaymentTimer->start(TRANSACTION_SEND_INTERVAL_MSECS);
} else {
qDebug() << "Missing OAuth provider URL, but assigned node payment was enabled. domain-server will now quit.";
QMetaObject::invokeMethod(this, "quit", Qt::QueuedConnection);
return false;
}
}
return true;