# Fetch records
database.cursor.execute("SELECT domain, origin, software FROM instances WHERE software = ? ORDER BY last_instance_fetch ASC", [software])
rows = database.cursor.fetchall()
-
- logger.info("Checking %d entries ...", len(rows))
- for row in rows:
- logger.debug("row[domain]='%s',row[origin]='%s',row[software]='%s'", row["domain"], row["origin"], row["software"])
- if row["software"] is None:
- logger.warning("row[domain]='%s' has no software detected. You can try to run ./fba.py update_nodeinfo --domain=%s --force-all to get it updated - SKIPPED!", row["domain"], row["domain"])
- continue
- elif software_helper.is_relay(row["software"]):
- logger.warning("row[domain]='%s' is a relay of type '%s' which is not supported by this command. Please invoke fetch_relays instead - SKIPPED!", row["domain"], row["software"])
- continue
- elif not args.force_all and not args.software in [None, ""] and instances.is_recent(row["domain"]):
- logger.debug("row[domain]='%s' has recently been crawled - SKIPPED!", row["domain"])
- continue
-
- # Initial fetch
- try:
- logger.info("Fetching instances from row[domain]='%s',row[origin]='%s',row[software]='%s' ...", row["domain"], row["origin"], row["software"])
- federation.fetch_instances(row["domain"], row["origin"], row["software"], inspect.currentframe().f_code.co_name)
- except network.exceptions as exception:
- logger.warning("Exception '%s' during fetching instances (fetch_instances) from row[domain]='%s'", type(exception), row["domain"])
- instances.set_last_error(row["domain"], exception)
- instances.update(row["domain"])
- continue
-
- if args.single:
- logger.debug("Not fetching more instances - EXIT!")
- return 0
-
- # Loop through some instances
- database.cursor.execute("SELECT domain, origin, software \
+ else:
+ # Loop through some instances
+ database.cursor.execute("SELECT domain, origin, software \
FROM instances \
WHERE software IN ( \
'pleroma' , 'mastodon', 'friendica' , 'misskey' , 'lemmy' , \
) \
ORDER BY total_peers DESC, last_response_time ASC, last_updated ASC"
)
+ rows = database.cursor.fetchall()
- rows = database.cursor.fetchall()
logger.info("Checking %d entries ...", len(rows))
for row in rows:
- logger.debug("row[domain]='%s'", row["domain"])
-
- if not domain_helper.is_wanted(row["domain"]):
- logger.warning("row[domain]='%s' is not wanted, you should execute remove_invalid for cleaning your database - SKIPPED!", row["domain"])
+ logger.debug("row[domain]='%s',row[origin]='%s',row[software]='%s'", row["domain"], row["origin"], row["software"])
+ if row["software"] is None:
+ logger.warning("row[domain]='%s' has no software detected. You can try to run ./fba.py update_nodeinfo --domain=%s --force-all to get it updated - SKIPPED!", row["domain"], row["domain"])
continue
- elif instances.is_recent(row["domain"]):
+ elif software_helper.is_relay(row["software"]):
+ logger.warning("row[domain]='%s' is a relay of type '%s' which is not supported by this command. Please invoke fetch_relays instead - SKIPPED!", row["domain"], row["software"])
+ continue
+ elif not args.force_all and not args.software in [None, ""] and instances.is_recent(row["domain"]):
logger.debug("row[domain]='%s' has recently been crawled - SKIPPED!", row["domain"])
continue
+ # Initial fetch
try:
- logger.info("Fetching instances for row[domain]='%s',origin='%s',software='%s' ...", row["domain"], row["origin"], row["software"])
+ logger.info("Fetching instances from row[domain]='%s',row[origin]='%s',row[software]='%s' ...", row["domain"], row["origin"], row["software"])
federation.fetch_instances(row["domain"], row["origin"], row["software"], inspect.currentframe().f_code.co_name)
except network.exceptions as exception:
logger.warning("Exception '%s' during fetching instances (fetch_instances) from row[domain]='%s'", type(exception), row["domain"])
instances.set_last_error(row["domain"], exception)
instances.update(row["domain"])
+ continue
logger.debug("Success - EXIT!")
return 0
"tunnel.silicon.moe" : "Testing/developing instances shouldn't be part of public instances",
"7988276.xyz" : "Testing/developing instances shouldn't be part of public instances",
"devtunnels.ms" : "Testing/developing instances shouldn't be part of public instances",
+ "srv.us" : "Testing/developing instances shouldn't be part of public instances",
"serveo.net" : "Provides service 'expose local servers to the internet'",
"hexbear.net" : "Is a Lemmy instance with malicious JavaScript code (shell commands)",
"mastodon.n41.lat" : "Somehow this instance repeatedly causes an OOM here",
"drankdrankdrank" : "Mass flooding of instances",
"cn24tv.it/page/" : "Useless massive pages",
"youtube.com/channel/" : "Useless massive YT channels",
+ "linodeusercontent.com" : "Some user-content hoster?",
}
@lru_cache