Better singleton names

This commit is contained in:
2024-02-23 13:24:03 -03:00
parent 810bf6b830
commit b27e6cb2ec
4 changed files with 14 additions and 14 deletions

View File

@@ -57,7 +57,7 @@ struct DBSettings {
}
}
class DB {
class Database {
protected DBSettings m_settings;
protected EntityMetaData m_schema;
protected DataSource m_ds;

View File

@@ -35,13 +35,13 @@ Config loadConfig() {
}
void initRequestPool(Config cfg) {
Rp = new RequestPool();
Rp.startBackground();
RP = new RequestPool();
RP.startBackground();
}
void initDatabase(Config cfg) {
Db = new DB(DBSettings.fromJson(cfg.v["db"]));
Db.connect();
DB = new Database(DBSettings.fromJson(cfg.v["db"]));
DB.connect();
}
void main() {
@@ -50,8 +50,8 @@ void main() {
commonInit();
scope (exit) {
Db.close();
Rp.stop();
DB.close();
RP.stop();
}
ASObject actor = apResolveRemoteUsername("@marisa@ak.gensokyo.shop");
@@ -70,7 +70,7 @@ void main() {
// headers["Accept"] = "application/activity+json";
// }
// Response rs = Rp.request(followers, true);
// Response rs = RP.request(followers, true);
// infoF!"followers: %s"(rs.responseBody);
}
@@ -105,11 +105,11 @@ void main() {
// }
// }
//
// Db = new DB(dbSettings);
// Db.connect();
// DB = new DB(dbSettings);
// DB.connect();
//
// scope (exit)
// Db.close();
// DB.close();
//
// return 0;
//}

View File

@@ -3,5 +3,5 @@ module singletons;
import db.db;
import net.request_pool;
DB Db;
RequestPool Rp;
Database DB;
RequestPool RP;

View File

@@ -46,7 +46,7 @@ PRequest buildAcctRequest(string uri, string acct) {
}
JSONValue wfRequestAccount(string uri, string acct) {
Response rs = Rp.request(buildAcctRequest(uri, acct), true);
Response rs = RP.request(buildAcctRequest(uri, acct), true);
if (checkValidWebfingerResponse(rs) == false)
throw new Exception("Invalid webfinger response");