Skip to content

Commit

Permalink
Remove soft dependency on blob package
Browse files Browse the repository at this point in the history
  • Loading branch information
wkmor1 committed Jul 19, 2023
1 parent 200143a commit 46df58f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ Imports:
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Suggests:
blob,
data.table,
DBI,
future,
Expand Down
8 changes: 6 additions & 2 deletions R/api_get.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ api_get <- function(obj) {

if (!DBI::dbExistsTable(fcp, "finbif_cache")) {

blob <- list()

init <- data.frame(
hash = character(),
created = as.POSIXct(numeric()),
timeout = numeric(),
blob = blob::blob()
blob = structure(blob, class = "vctrs_vctr")
)

DBI::dbWriteTable(fcp, "finbif_cache", init)
Expand Down Expand Up @@ -410,13 +412,15 @@ append_obj <- function(obj) {

blob <- serialize(obj, NULL)

blob <- list(blob)

hash <- obj[["hash"]]

db_cache <- data.frame(
hash = hash,
created = Sys.time(),
timeout = obj[["timeout"]],
blob = blob::blob(blob)
blob = structure(blob, class = "vctrs_vctr")
)

debug_msg("[", as.character(Sys.time()), "] ", "Adding to cache: ", hash)
Expand Down
14 changes: 1 addition & 13 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,6 @@
}
],
"softwareSuggestions": [
{
"@type": "SoftwareApplication",
"identifier": "blob",
"name": "blob",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=blob"
},
{
"@type": "SoftwareApplication",
"identifier": "data.table",
Expand Down Expand Up @@ -257,7 +245,7 @@
"applicationCategory": "Biodiversity",
"isPartOf": "https://species.fi",
"keywords": ["api", "biodiversity", "biodiversity-informatics", "biodiversity-information", "finbif", "finbif-access", "occurrences", "r-package", "r-programming", "rstats", "species", "specimens", "taxon", "taxonomy", "web-services"],
"fileSize": "5374.771KB",
"fileSize": "5374.86KB",
"citation": [
{
"@type": "SoftwareSourceCode",
Expand Down

0 comments on commit 46df58f

Please sign in to comment.