flickarr 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db2edb2977bb888a2d99120d14ec6f9d7fe3ef105618870ccf1ff075bdc196f5
4
- data.tar.gz: 4f38435d1fff9d1235a23dd4717bac0c85d7ca5e16fd4b3a82ed421e7e349682
3
+ metadata.gz: 047771d3b777387881e11c1bbe210a0ab9b6ff75a26a30fbff7e856a337fe3f7
4
+ data.tar.gz: 4b13d68b86693ec63c75fca5ca4116cf166b2a6c711368245d9a75afd5051eb3
5
5
  SHA512:
6
- metadata.gz: 954b3c5e1e8bdd59dac42b7ad8574541012022971cdd2095e6d28bc8a394ca9f5a55c0c0786216d7b29ebb0f92cae4fd6d9da80d759602333ff0919f3ea6a21d
7
- data.tar.gz: 43b8f47b7b1812b0dc863401be1f72c9b75fbc4d87abcdf7c86743f578883f832217b0756d128e5077b578499dbb8849ad95de604b0214fd13c66aee053ab3fa
6
+ metadata.gz: bd2b1b6a9c71c7fef881a49c58866ffa35948a1e76a96614c7f662c3a9b04c183294ab605edf3bfaf218a9d4eed2d8ab703caa813e1612ae9da20ae1f6e9a311
7
+ data.tar.gz: e0653f10a829f86efd3c4c7635d3054090c45339164a03d1e4dfce74a7edd47fc70bd6aab040f0f9f134e27f5a231d7fd26f81e5c8abf4812fb747e85ff1dfd9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.4] - 2026-03-22
4
+
5
+ - Retry transient network errors (connection reset, timeouts, HTML-instead-of-JSON) up to 3 times with backoff
6
+
3
7
  ## [0.1.3] - 2026-03-22
4
8
 
5
9
  - Fix crash on photos with partial location data (e.g. coordinates but no locality)
data/lib/flickarr/cli.rb CHANGED
@@ -459,7 +459,19 @@ module Flickarr
459
459
 
460
460
  catch(:stop_export) do
461
461
  loop do
462
- response = fetch_posts_page(client: client, config: config, media: media, page: page)
462
+ page_retries = 3
463
+ begin
464
+ response = fetch_posts_page(client: client, config: config, media: media, page: page)
465
+ rescue Errno::ECONNRESET, JSON::ParserError, Net::OpenTimeout, Net::ReadTimeout, Errno::ETIMEDOUT => e
466
+ page_retries -= 1
467
+ if page_retries.positive?
468
+ warn "Transient error fetching page #{page}: #{e.message} — retrying in 5s (#{page_retries} left)"
469
+ sleep 5
470
+ retry
471
+ end
472
+ warn "Failed to fetch page #{page} after retries: #{e.message}"
473
+ break
474
+ end
463
475
  total = response.total.to_i
464
476
  total_pages = response.pages.to_i
465
477
 
@@ -531,12 +543,23 @@ module Flickarr
531
543
  end
532
544
 
533
545
  def export_single_post client:, config:, post_id:, count:, total:
546
+ retries = 3
534
547
  query = client.photo(id: post_id)
535
548
  archive = config.archive_path
536
549
 
537
550
  begin
538
551
  post = Post.build(info: query.info, sizes: query.sizes.size, exif: query.exif)
539
552
  status = post.write(archive_path: archive, overwrite: @overwrite)
553
+ rescue Errno::ECONNRESET, JSON::ParserError, Net::OpenTimeout, Net::ReadTimeout, Errno::ETIMEDOUT => e
554
+ retries -= 1
555
+ if retries.positive?
556
+ warn "Transient error on post #{post_id}: #{e.message} — retrying in 5s (#{retries} left)"
557
+ sleep 5
558
+ retry
559
+ end
560
+ warn "Failed post #{post_id} after retries: #{e.message}"
561
+ log_error archive: archive, post_id: post_id, username: config.username, error: e
562
+ return
540
563
  rescue Flickr::FailedResponse => e
541
564
  warn "Error on post #{post_id}: #{e.message}"
542
565
  log_error archive: archive, post_id: post_id, username: config.username, error: e
@@ -1,3 +1,3 @@
1
1
  module Flickarr
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flickarr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Becker