title: Access a service from a Job in Vapor 3
body: <p>I'm very new to Vapor and server-side swift, with a background in iOS development (6 years developing apps). I'm trying to build a simple API for device management which amongst other things includes a "job" (Timer whatever you want to call it) which checks every hour or so for the last time a device "Checked In".</p>
  
  <p>To do this I've setup the Jobs package, however I'm struggling to work out how I can access a service (<a href="https://github.com/vapor-community/ferno" rel="nofollow noreferrer">Ferno</a>) to hit my Firebase Realtime database to get info about when devices last logged in. It seems that according to the docs you need an implementer of <code>Container</code> to create/access a <code>Service</code> but there doesn't seem to be any kind of global container I can use.</p>
  
  <p>Should I be attempting to create my own <code>Request</code> just to access a <code>Ferno</code> service? Or is there a way I can access the global <code>app</code>?</p>
  
  <p>The below is what I have so far, but what I'm doing seems horribly wrong! Surely there must be a way to achieve this?</p>
  
  <pre><code>Jobs.add(interval: (60*30).seconds) { [weak devicesController] in
      devicesController?.checkForNotSeenDevices()
  }
  </code></pre>
  
  <pre><code>func checkForNotSeenDevices() throws {
  
      let client = try app(.detect()).make(FernoClient.self)
      client.ferno.retrieve(req: ???, queryItems: [], appendedPath: ["devices"])
  }
  </code></pre>